Skip to content

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

@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 related. 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