Merge between Font Attribute and Font Family in same Label #383

MusabAlrmmahMusabAlrmmah ✭✭USMember ✭✭

how to use FontAttribute and FontFamily in same Label ?
and how to use converter in FontFamily ?

please any solution

Answers

  • ClintStLaurentClintStLaurent ✭✭✭✭✭ USUniversity ✭✭✭✭✭
    edited March 2018

    There's nothing tricky about them. Just set the properties.

    <Label FontAttributes="Bold"></Label>

  • MusabAlrmmahMusabAlrmmah ✭✭ USMember ✭✭

    @ClintStLaurent When I Apply FontAttribute Does not apply FontFamily
    Why??

  • ClintStLaurentClintStLaurent ✭✭✭✭✭ USUniversity ✭✭✭✭✭

    But FontFamily works if it is by itself?
    Try swapping the order of the attributes. I know order does matter even though it isn't supposed to. For example Style has to be last or all the other attributes overwrite the style's values.

  • MusabAlrmmahMusabAlrmmah ✭✭ USMember ✭✭

    @ClintStLaurent

    Did not work
    look this my code

    <ContentView.Resources>

            <converter:BooleanToObjectConverter x:Key="isStaredIconConverter" x:TypeArguments="x:String"
                        TrueValue="{ x:Static local:GrialShapesFont.Star }" 
                        FalseValue="{ x:Static local:GrialShapesFont.StarBorder }"/>
    
            <converter:BooleanToObjectConverter x:Key="isReadConverter" x:TypeArguments="FontAttributes">
                <converter:BooleanToObjectConverter.TrueValue>
                    <FontAttributes>None</FontAttributes>
    
                </converter:BooleanToObjectConverter.TrueValue>
                <converter:BooleanToObjectConverter.FalseValue>
    
                    <FontAttributes>Bold</FontAttributes>
    
                </converter:BooleanToObjectConverter.FalseValue>
            </converter:BooleanToObjectConverter>
    
    
    
    
        </ResourceDictionary>
    </ContentView.Resources>
    
    
    
                  <Label 
            Text="{Binding V_SENDER_NAME}" 
            HorizontalOptions="Fill"
            VerticalOptions="EndAndExpand"
            TextColor="{ DynamicResource AccentColor }"
                         FontFamily="{ DynamicResource DroidKufiRegular }"
                         FontSize="{ artina:OnOrientationDouble
                               PortraitPhone=18,
                               LandscapePhone=18,                                
                            PortraitTablet=20,
                            LandscapeTablet=20 }"
                 FontAttributes="{Binding IsRead,Converter={ StaticResource isReadConverter }"
                            >
    
    
                    </Label>
    
  • ClintStLaurentClintStLaurent ✭✭✭✭✭ USUniversity ✭✭✭✭✭

    And the point of that post was... ???

  • MusabAlrmmahMusabAlrmmah ✭✭ USMember ✭✭

    @ClintStLaurent
    please send me example how to use FontFamily with FontAttributes in same label

Sign In or Register to comment.