That is, only BOLD, EXTRA_BOLD and BLACK are matched to the Bold face and *everything* else ends up - defaulting rather than matching I think - to Black. = Font.font("Source Code Pro", FontWeight.BLACK, 13)) = Font.font("Source Code Pro", FontWeight.EXTRA_BOLD, 13)) = Font.font("Source Code Pro", FontWeight.BOLD, 13)) = Font.font("Source Code Pro", FontWeight.SEMI_BOLD, 13)) = Font.font("Source Code Pro", FontWeight.MEDIUM, 13)) = Font.font("Source Code Pro", FontWeight.NORMAL, 13)) = Font.font("Source Code Pro", FontWeight.LIGHT, 13)) = Font.font("Source Code Pro", FontWeight.EXTRA_LIGHT, 13)) = Font.font("Source Code Pro", FontWeight.THIN, 13)) Meanwhile, actually iterating through the FontWeight enum on the Mac gets you: The same call would fail on the Mac, because "Source Code Pro Light" is not a family name, and you end up with the system font: However, while on Linux, an automatically generated font picker dialogue, or code that understand that this is happening, can ultimately use this to pick the desired weight, eg: It looks like the Mac is doing the more logical thing, presenting one family with all the weights in it whereas on Linux only Bold is recognised as a Weight, and all the others are interpreted as font families in their own right. On Mac, Font.getFontNames("SourceCodePro") returns: On Mac, Font.getFamilies() (|grep "Source Code Pro") returns: Worth remembering in relation to the FontWeight enum. This font family has the weights: Regular, ExtraLight, Light, Medium, Black, Bold, Semibold. A user install is fine (ie: on Linux, just dropping them into ~/.fonts, on Mac, by using Font Book) On Mac, you just can't get at most of the font weights, including the regular one, for such font families.Įxample: Install Adobe's "Source Code Pro" font family into a Linux and a Mac system. Linux behaviour seems broken as well, but at least in such a way that all the fonts are ultimately selectable. However, with such families, strange things happen, and different things on OSX and Linux. Some font families have more weights than this. If a font family only has fonts Regular, Italic, Bold, Bold Italic, or fewer, everything seems to work as you'd expect.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |