Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child Span font attributes inheritance #26197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Nov 28, 2024

Issues Fixed

Fixes #21034

<Label TextColor="Blue"
        TextDecorations="Underline"
        FontAttributes="Bold">
    <Label.FormattedText>
        <FormattedString>
            <Span Text="Bold, underlined, blue"/>
            <Span Text="  "
                    TextDecorations="None"/>
            <Span Text="Green, italic"
                    TextColor="Green"
                    TextDecorations="None"
                    FontAttributes="Italic"/>
            <Span Text="  "
                    TextDecorations="None"/>
            <Span FontAttributes="Bold"
                    TextColor="Red"
                    TextDecorations="Strikethrough"
                    Text="Red, strikethrough"/>
            <Span Text="  "
                    TextDecorations="None"/>
            <Span FontAttributes="None"
                    TextColor="Black"
                    FontFamily="Lobster Two BoldItalic"
                    TextDecorations="None"
                    Text="Black, doko font family"/>
        </FormattedString>
    </Label.FormattedText>
</Label>
Before After

@kubaflo kubaflo requested a review from a team as a code owner November 28, 2024 11:19
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 28, 2024
Copy link
Contributor

Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build is failing:

D:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\FormattedStringTests.cs(31,38): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-ios]
    8811 Warning(s)
    16 Error(s)

@kubaflo
Copy link
Contributor Author

kubaflo commented Nov 28, 2024

The build is failing:

D:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\FormattedStringTests.cs(31,38): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-ios]
    8811 Warning(s)
    16 Error(s)

Thanks! I haven't noticed it. Fixed :)

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@kubaflo
Copy link
Contributor Author

kubaflo commented Nov 28, 2024

@jsuarezruiz could you please /azp again?

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D:\a\_work\1\s\src\Compatibility\Core\src\iOS\Renderers\LabelRenderer.cs(485,40): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net9.0-ios18.0]
D:\a\_work\1\s\src\Compatibility\Core\src\iOS\Renderers\SearchBarRenderer.cs(339,50): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net9.0-ios18.0]
D:\a\_work\1\s\src\Compatibility\Core\src\iOS\Renderers\SearchBarRenderer.cs(345,50): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net9.0-ios18.0]
D:\a\_work\1\s\src\Compatibility\Core\src\iOS\Renderers\EntryRenderer.cs(360,43): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net9.0-ios18.0]
D:\a\_work\1\s\src\Compatibility\Core\src\iOS\Renderers\EntryRenderer.cs(366,43): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net9.0-ios18.0]
D:\a\_work\1\s\src\Compatibility\Core\src\iOS\Renderers\PickerRenderer.cs(231,43): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net9.0-ios18.0]
D:\a\_work\1\s\src\Compatibility\Core\src\iOS\Renderers\PickerRenderer.cs(237,43): error CS0121: The call is ambiguous between the following methods or properties: 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform)' and 'FormattedStringExtensions.ToNSAttributedString(FormattedString, IFontManager, double, TextAlignment, Font?, Color?, TextTransform, TextDecorations, FontAttributes)' [D:\a\_work\1\s\src\Compatibility\Core\src\Compatibility.csproj::TargetFramework=net9.0-ios18.0]
    8811 Warning(s)
    14 Error(s)

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Child Span does not inherit TextColor or FontAttributes from parent Label
3 participants