FontFamily does not seem to work for spans on Android #1131

Closed
stonecourier opened this Issue Nov 21, 2015 · 6 comments

Comments

Projects
None yet
4 participants
@stonecourier

Setting via xml or code does not work when using FontAwesome
If you just set text property and font family it does work.

https://twitter.com/vladimir_enchev/status/660034284791681024
http://pastie.org/10517753#3

 <Label>
          <Label.formattedText>
            <FormattedString>
              <FormattedString.spans>
                <Span text="" fontFamily="FontAwesome" />
                <Span text="NativeScript"  />
              </FormattedString.spans>
            </FormattedString>
          </Label.formattedText>
        </Label>
@enchev

This comment has been minimized.

Show comment
Hide comment
@enchev

enchev Nov 23, 2015

Contributor

Hey @stonecourier,

Here is a temporary workaround:

<Page>
  <Label style="font-family: FontAwesome;">
    <Label.formattedText>
      <FormattedString>
        <FormattedString.spans>
          <Span ios:text="&#xf179;" android:text="&#xf17b;" />
          <Span text="NativeScript"  />
        </FormattedString.spans>
      </FormattedString>
    </Label.formattedText>
  </Label>
</Page>
Contributor

enchev commented Nov 23, 2015

Hey @stonecourier,

Here is a temporary workaround:

<Page>
  <Label style="font-family: FontAwesome;">
    <Label.formattedText>
      <FormattedString>
        <FormattedString.spans>
          <Span ios:text="&#xf179;" android:text="&#xf17b;" />
          <Span text="NativeScript"  />
        </FormattedString.spans>
      </FormattedString>
    </Label.formattedText>
  </Label>
</Page>
@stonecourier

This comment has been minimized.

Show comment
Hide comment
@stonecourier

stonecourier Nov 23, 2015

Thanks, I got it working so I can now build several user controls based on FontAwesome http://stonecourier.blogspot.com.au/2015/11/using-font-awesome-to-build-your-own.html

Thanks, I got it working so I can now build several user controls based on FontAwesome http://stonecourier.blogspot.com.au/2015/11/using-font-awesome-to-build-your-own.html

@amjd

This comment has been minimized.

Show comment
Hide comment
@amjd

amjd Nov 25, 2015

@enchev Can you please explain me why the unicode value for the icon is different for iOS and Android? Also, how do we find these values?

amjd commented Nov 25, 2015

@enchev Can you please explain me why the unicode value for the icon is different for iOS and Android? Also, how do we find these values?

@stonecourier

This comment has been minimized.

Show comment
Hide comment
@stonecourier

stonecourier Nov 25, 2015

Because on IOS, he is making it display the apple logo and on android the android logo. Values can be found here https://fortawesome.github.io/Font-Awesome/cheatsheet/

Because on IOS, he is making it display the apple logo and on android the android logo. Values can be found here https://fortawesome.github.io/Font-Awesome/cheatsheet/

@amjd

This comment has been minimized.

Show comment
Hide comment
@amjd

amjd Nov 27, 2015

@stonecourier Thanks for the clarification! I should have spotted that. 😁

amjd commented Nov 27, 2015

@stonecourier Thanks for the clarification! I should have spotted that. 😁

@nsndeck

This comment has been minimized.

Show comment
Hide comment
@nsndeck

nsndeck Nov 30, 2015

Contributor

Just a quick follow up - the original issue has been fixed with commit #1162.

Contributor

nsndeck commented Nov 30, 2015

Just a quick follow up - the original issue has been fixed with commit #1162.

@nsndeck nsndeck closed this Nov 30, 2015

@nsndeck nsndeck added the done label Nov 30, 2015

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