Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Custom fonts - Dealing with multiple versions of the same fontsΒ #6607

Closed
@nelsonkam

Description

@nelsonkam

I'm trying to apply a custom font to my app but I ran into a bug (I'm not sure I can call it a bug though 😏 ). So this is the issue, adding these two code snippets (separately) results into two different renderings.

fonts:
  - family: Rubik
    fonts:
      - asset: assets/fonts/Rubik-Black.ttf
      - asset: assets/fonts/Rubik-Medium.ttf
      - asset: assets/fonts/Rubik-Regular.ttf

Renders this:

images_n76ykujg5vsb6v2gzbcejy1psct2_1477951914510screenshot_2016-10-31-23-11-35

fonts:
  - family: Rubik
    fonts:
      - asset: assets/fonts/Rubik-Regular.ttf
      - asset: assets/fonts/Rubik-Medium.ttf
      - asset: assets/fonts/Rubik-Black.ttf

Renders this:

images_n76ykujg5vsb6v2gzbcejy1psct2_1477952404355screenshot_2016-10-31-23-19-55

It seems that the order of the assets matters or that the fonts mapping only considers the first asset. Anyway this is a strange behavior.

Flutter Version

Flutter β€’ channel master β€’ https://github.com/flutter/flutter.git
Framework β€’ revision b41645c (3 days ago) β€’ 2016-10-28 14:37:17
Engine β€’ revision 1bc79de
Tools β€’ Dart 1.21.0-dev.2.0

Metadata

Metadata

Assignees

Labels

engineflutter/engine repository. See also e: labels.toolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions