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

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

stonecourier commented Nov 21, 2015

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.

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.

stonecourier commented 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

@amjd

This comment has been minimized.

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.

stonecourier commented 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/

@amjd

This comment has been minimized.

amjd commented Nov 27, 2015

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

@nsndeck

This comment has been minimized.

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