Reputation: 2115
When I use a font like Tahoma, I can specify font-family="Tahoma" font-weight="bold"
and my output uses the bold variant of the font.
Now I have a font named Geogrotesque, with a variation named 'semibold'. This is a separate font file named Geogrotesque-Semibold. Font weight of this variation is 600.
I can't get this font to appear in my output. font-family="Geogrotesque" font-weight="600"
is output as Bold (font-weight=700) instead, font-family="Geogrotesque-Semibold"
gives a 'font not found' error.
I'm using Antennahouse. W3.org gives no clue how a font name corresponds to the identifiers in the font file. There are more fonts with names that don't seem to fit the font-family/weight/style pattern. Browsing through my Windows/Fonts folder I find fonts with modifiers like Condensed and Narrow. How do I use fonts like these?
Upvotes: 2
Views: 592
Reputation: 2115
In FontForge, you can see which font-weight is assigned to a font.
In Element->Font Info, go to the OS/2 tab. The Weight class dropdown contains this list:
100 Thin
200 Extra light
300 Light
400 Regular
500 Medium
600 Semi-bold
700 Bold
800 Extra bold
900 Black
Upvotes: 0
Reputation: 8068
Try font-weight="500"
.
From https://www.w3.org/TR/xsl11/#font-weight:
If there is both a face labeled Medium and one labeled Book, Regular, Roman or Normal, then the Medium is normally assigned to the '500'.
The font labeled "Bold" will often correspond to the weight value '700'.
If there are fewer then 9 weights in the family, the default algorithm for filling the "holes" is as follows. If '500' is unassigned, it will be assigned the same font as '400'. If any of the values '600', '700', '800', or '900' remains unassigned, they are assigned to the same face as the next darker assigned keyword, if any
So 'Semibold' may have been assigned '500', and '600' was, apparently, assigned to the next darker assigned keyword, i.e., 'bold'.
Alternatively, try font-weight="darker"
(when the inherited font-weight is normal
, that is). AH Formatter should then use the semibold if it has found it.
Alternatively, add an alias in your AH Formatter font configuration file. See https://www.antennahouse.com/product/ahf64/ahf-font.html#font-configration-file. E.g.,
<font-alias file="Geogrotesque-Semibold.ttf">
<alias family-name="Geogrotesque" weight="500"/>
</font-alias>
For 'Condensed' and 'Narrow', etc., use the font-stretch
property, .e.g., font-stretch="condensed"
. See https://www.w3.org/TR/xsl11/#font-stretch
Upvotes: 2