Questions regarding fonts: obliques (fake italics), ligatures and kerning
Hi, I played around with different fonts, especially Bitstream XCharter and Overpass (http://overpassfont.org/) and wanted to combine them. However, I see some issues regarding ligatures, kerning and obliques/italics. Here is a minimal example: ``` \definefontfeature[default][mode=node, kern=yes, liga=yes] % more features % [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, protrusion=quality, expansion=quality] \definefontfamily [myfont][roman][xcharter] \definefontfamily [myfont][sansserif][overpass][rscale=0.93] \definefontfamily [myfont][teletype][overpass][rscale=0.93] \definefontfamily [myfont][mono][overpassmono][rscale=0.93] \definetypeface [myfont][mathematics][math] [xcharter] \setupbodyfont[myfont, 11pt] \startTEXpage \showfontkerns Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}\\ \style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \showbodyfont[myfont] \stopTEXpage ``` It produces the PDF in the attachment. I'm struggling with several things: - xcharter seems to have no kerning applied. It is listed as font feature, though. Is it correct to have no kerning at all for that font? - xcharter also have no ligatures (at least it doesn't look like that). That is listed as font feature, too, although only for italic and slanted. According to https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font. - Overpass has a glyph for the ae ligature. Is it normal that it is not used as a ligature for ae? - Overpass Mono does not contain italic glyphs. I would have expected obliques when using \slanted then. However, it just remains normal. - I included the ™ in the example since its italic glyph is not slanted. For all fonts \slanted seems to switch to the extra (italic?) glyphs, while I would have expected obliques. At least overpass seems to have no dedicated slanted style, while xcharter has one. - Is there a command to show ligatures the same way there is a command for kerning? I attached the output of the following commands, too: mtxrun --script font --list --file --info --pattern='xcharter*' mtxrun --script font --list --file --info --pattern='overpass*' Thanks Gerion
Gerion Entrup schrieb am 27.08.2024 um 21:28:
Hi,
I played around with different fonts, especially Bitstream XCharter and Overpass (http://overpassfont.org/) and wanted to combine them. However, I see some issues regarding ligatures, kerning and obliques/italics.
Here is a minimal example: ``` \definefontfeature[default][mode=node, kern=yes, liga=yes] % more features % [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, protrusion=quality, expansion=quality]
There is no need to set default features like ligatures and kerning, the better alternative here is to use \definefontfeature [default] [default] [protrusion=quality,...] which adds additional settings to the default set.
\definefontfamily [myfont][roman][xcharter] \definefontfamily [myfont][sansserif][overpass][rscale=0.93] \definefontfamily [myfont][teletype][overpass][rscale=0.93] \definefontfamily [myfont][mono][overpassmono][rscale=0.93] \definetypeface [myfont][mathematics][math] [xcharter]
\setupbodyfont[myfont, 11pt]
\startTEXpage
\showfontkerns
Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}\\ \style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\
\showbodyfont[myfont]
\stopTEXpage ``` It produces the PDF in the attachment. I'm struggling with several things: - xcharter seems to have no kerning applied. It is listed as font feature, though. Is it correct to have no kerning at all for that font?
The font has kerning information but none for characters in the ASCII range.
- xcharter also have no ligatures (at least it doesn't look like that). That is listed as font feature, too, although only for italic and slanted. According to https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font.
There are ligatures for ff[il].
- Overpass has a glyph for the ae ligature. Is it normal that it is not used as a ligature for ae?
This seems to be a stupid decision to replace ae by default with a ligature, maybe dependent on the language but not for all of them.
- Overpass Mono does not contain italic glyphs. I would have expected obliques when using \slanted then. However, it just remains normal.
You can use the slanted feature for this but the default setting is to fall back to the upright alternative and you as a user has to make the choice. Example: \definefontfamily[myfont][tt][overpassmono][sl={features:slanted}]
- I included the ™ in the example since its italic glyph is not slanted. For all fonts \slanted seems to switch to the extra (italic?) glyphs, while I would have expected obliques. At least overpass seems to have no dedicated slanted style, while xcharter has one.
How a glyph for a certain styles appears depends on the font designer. When you use \definefontfamily you get always the same style for italic and slanted because most fonts provide only italic or oblique (but not both). In some case you do something like the following font setting but the best solution when you have a large font family have is to write a typescript. \definefontfamily[myfont][rm][xcharter][sl=style:slanted] Wolfgang
Am Dienstag, 27. August 2024, 22:30:16 MESZ schrieb Wolfgang Schuster:
Gerion Entrup schrieb am 27.08.2024 um 21:28:
Hi,
I played around with different fonts, especially Bitstream XCharter and Overpass (http://overpassfont.org/) and wanted to combine them. However, I see some issues regarding ligatures, kerning and obliques/italics.
Here is a minimal example: ``` \definefontfeature[default][mode=node, kern=yes, liga=yes] % more features % [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, protrusion=quality, expansion=quality]
There is no need to set default features like ligatures and kerning, the better alternative here is to use
\definefontfeature [default] [default] [protrusion=quality,...]
which adds additional settings to the default set.
\definefontfamily [myfont][roman][xcharter] \definefontfamily [myfont][sansserif][overpass][rscale=0.93] \definefontfamily [myfont][teletype][overpass][rscale=0.93] \definefontfamily [myfont][mono][overpassmono][rscale=0.93] \definetypeface [myfont][mathematics][math] [xcharter]
\setupbodyfont[myfont, 11pt]
\startTEXpage
\showfontkerns
Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}\\ \style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\
\showbodyfont[myfont]
\stopTEXpage ``` It produces the PDF in the attachment. I'm struggling with several things: - xcharter seems to have no kerning applied. It is listed as font feature, though. Is it correct to have no kerning at all for that font?
The font has kerning information but none for characters in the ASCII range.
Good to know. Especially for the "Va" in "Vase", I expected kerning (it looks not equally spaced currently).
- xcharter also have no ligatures (at least it doesn't look like that). That is listed as font feature, too, although only for italic and slanted. According to https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font.
There are ligatures for ff[il].
They are defined in the font, but they are not used in the PDF output, aren't they? For example in the "ffi" in "Effizient" the "f" is not connected with the "i", while the ligature glyph has a connection there. I attached a screenshot for comparison. The ligature was generated with "\ShowCompleteFont{name:xcharter*default}{11pt}{1}" (with the fnt-10 module). It is, however, noticeable that the whole xcharter font is thicker in the output of \ShowCompleteFont. Is this part of the reason?
- Overpass has a glyph for the ae ligature. Is it normal that it is not used as a ligature for ae?
This seems to be a stupid decision to replace ae by default with a ligature, maybe dependent on the language but not for all of them.
Ok, I've seen it here as (somewhat) common ligature: https://en.wikipedia.org/wiki/Ligature_(writing)#Computer_typesetting But there is also mentioned that TeX just has ff, fi, fl, ffi and ffl by default.
- Overpass Mono does not contain italic glyphs. I would have expected obliques when using \slanted then. However, it just remains normal.
You can use the slanted feature for this but the default setting is to fall back to the upright alternative and you as a user has to make the choice.
Example: \definefontfamily[myfont][tt][overpassmono][sl={features:slanted}]
Thank you! That make sense.
- I included the ™ in the example since its italic glyph is not slanted. For all fonts \slanted seems to switch to the extra (italic?) glyphs, while I would have expected obliques. At least overpass seems to have no dedicated slanted style, while xcharter has one.
How a glyph for a certain styles appears depends on the font designer.
When you use \definefontfamily you get always the same style for italic and slanted because most fonts provide only italic or oblique (but not both). In some case you do something like the following font setting but the best solution when you have a large font family have is to write a typescript.
\definefontfamily[myfont][rm][xcharter][sl=style:slanted]
Thank you for the explanation. That sounds meaningful. Gerion
Gerion Entrup schrieb am 27.08.2024 um 23:29:
Am Dienstag, 27. August 2024, 22:30:16 MESZ schrieb Wolfgang Schuster:
Gerion Entrup schrieb am 27.08.2024 um 21:28:
Hi,
I played around with different fonts, especially Bitstream XCharter and Overpass (http://overpassfont.org/) and wanted to combine them. However, I see some issues regarding ligatures, kerning and obliques/italics.
Here is a minimal example: ``` \definefontfeature[default][mode=node, kern=yes, liga=yes] % more features % [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, protrusion=quality, expansion=quality] There is no need to set default features like ligatures and kerning, the better alternative here is to use
\definefontfeature [default] [default] [protrusion=quality,...]
which adds additional settings to the default set.
\definefontfamily [myfont][roman][xcharter] \definefontfamily [myfont][sansserif][overpass][rscale=0.93] \definefontfamily [myfont][teletype][overpass][rscale=0.93] \definefontfamily [myfont][mono][overpassmono][rscale=0.93] \definetypeface [myfont][mathematics][math] [xcharter]
\setupbodyfont[myfont, 11pt]
\startTEXpage
\showfontkerns
Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}\\ \style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\
\showbodyfont[myfont]
\stopTEXpage ``` It produces the PDF in the attachment. I'm struggling with several things: - xcharter seems to have no kerning applied. It is listed as font feature, though. Is it correct to have no kerning at all for that font? The font has kerning information but none for characters in the ASCII range. Good to know. Especially for the "Va" in "Vase", I expected kerning (it looks not equally spaced currently).
- xcharter also have no ligatures (at least it doesn't look like that). That is listed as font feature, too, although only for italic and slanted. According to https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font. There are ligatures for ff[il]. They are defined in the font, but they are not used in the PDF output, aren't they? For example in the "ffi" in "Effizient" the "f" is not connected with the "i", while the ligature glyph has a connection there.
You have to change the value of the script tag because the don't set them for the dflt script. \definefontfeature[default][default][script=latn] \definefontfamily[myfont][rm][xcharter] \setupbodyfont[myfont] \showmakeup[glyph] \starttext ff fi fl ffi ffl fb fh fk \feature[-][ligatures] ff fi fl ffi ffl fb fh fk \stoptext
I attached a screenshot for comparison. The ligature was generated with "\ShowCompleteFont{name:xcharter*default}{11pt}{1}" (with the fnt-10 module). It is, however, noticeable that the whole xcharter font is thicker in the output of \ShowCompleteFont. Is this part of the reason?
When you load a font by name use one which is listed in the table you get with "mtxrun --script fonts --list --all --pattern=xcharter*". In this case the table is identifier familyname fontname filename subfont instances xcharterbold xcharter xcharterbold XCharter-Bold.otf xcharterbolditalic xcharter xcharterbolditalic XCharter-BoldItalic.otf xcharterboldslanted xcharter xcharterboldslanted XCharter-BoldSlanted.otf xcharteritalic xcharter xcharteritalic XCharter-Italic.otf xchartermath xchartermath xchartermath XCharter-Math.otf xchartermathbold xchartermathbold xchartermathbold XCharter-Math-Bold.otf xchartermathmedium xchartermath xchartermath XCharter-Math.otf xchartermathregular xchartermath xchartermath XCharter-Math.otf xcharternormal xcharter xcharteritalic XCharter-Italic.otf xcharterregular xcharter xcharterroman XCharter-Roman.otf xcharterroman xcharter xcharterroman XCharter-Roman.otf xcharterslanted xcharter xcharterslanted XCharter-Slanted.otf and as you can see there is no entry "xcharter". In your case context loaded the bold version of the font but when you use "xcharterroman" as name the document shows the normal upright version.
- Overpass has a glyph for the ae ligature. Is it normal that it is not used as a ligature for ae? This seems to be a stupid decision to replace ae by default with a ligature, maybe dependent on the language but not for all of them. Ok, I've seen it here as (somewhat) common ligature: https://en.wikipedia.org/wiki/Ligature_(writing)#Computer_typesetting But there is also mentioned that TeX just has ff, fi, fl, ffi and ffl by default.
What is available or not depends on the font and even then there can be differences between different version of a font. Wolfgang
Hi, thank you, that answers all my questions! Gerion Am Mittwoch, 28. August 2024, 00:03:34 MESZ schrieb Wolfgang Schuster:
Gerion Entrup schrieb am 27.08.2024 um 23:29:
Am Dienstag, 27. August 2024, 22:30:16 MESZ schrieb Wolfgang Schuster:
Gerion Entrup schrieb am 27.08.2024 um 21:28:
Hi,
I played around with different fonts, especially Bitstream XCharter and Overpass (http://overpassfont.org/) and wanted to combine them. However, I see some issues regarding ligatures, kerning and obliques/italics.
Here is a minimal example: ``` \definefontfeature[default][mode=node, kern=yes, liga=yes] % more features % [mode=node, kern=yes, liga=yes, tlig=yes, itlg=yes, ccmp=yes, language=dflt, protrusion=quality, expansion=quality] There is no need to set default features like ligatures and kerning, the better alternative here is to use
\definefontfeature [default] [default] [protrusion=quality,...]
which adds additional settings to the default set.
\definefontfamily [myfont][roman][xcharter] \definefontfamily [myfont][sansserif][overpass][rscale=0.93] \definefontfamily [myfont][teletype][overpass][rscale=0.93] \definefontfamily [myfont][mono][overpassmono][rscale=0.93] \definetypeface [myfont][mathematics][math] [xcharter]
\setupbodyfont[myfont, 11pt]
\startTEXpage
\showfontkerns
Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}\\ \style[sans]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\ \style[mono]{Vitae, Vase, LT, VA, Y., Effizient, abcdel™, \italic{effi abcdel™}, \slanted{effi abcdel™}}\\
\showbodyfont[myfont]
\stopTEXpage ``` It produces the PDF in the attachment. I'm struggling with several things: - xcharter seems to have no kerning applied. It is listed as font feature, though. Is it correct to have no kerning at all for that font? The font has kerning information but none for characters in the ASCII range. Good to know. Especially for the "Va" in "Vase", I expected kerning (it looks not equally spaced currently).
- xcharter also have no ligatures (at least it doesn't look like that). That is listed as font feature, too, although only for italic and slanted. According to https://tug.org/FontCatalogue/xcharter/ there are ligatures in the font. There are ligatures for ff[il]. They are defined in the font, but they are not used in the PDF output, aren't they? For example in the "ffi" in "Effizient" the "f" is not connected with the "i", while the ligature glyph has a connection there.
You have to change the value of the script tag because the don't set them for the dflt script.
\definefontfeature[default][default][script=latn]
\definefontfamily[myfont][rm][xcharter]
\setupbodyfont[myfont]
\showmakeup[glyph]
\starttext
ff fi fl ffi ffl fb fh fk
\feature[-][ligatures]
ff fi fl ffi ffl fb fh fk
\stoptext
I attached a screenshot for comparison. The ligature was generated with "\ShowCompleteFont{name:xcharter*default}{11pt}{1}" (with the fnt-10 module). It is, however, noticeable that the whole xcharter font is thicker in the output of \ShowCompleteFont. Is this part of the reason?
When you load a font by name use one which is listed in the table you get with "mtxrun --script fonts --list --all --pattern=xcharter*". In this case the table is
identifier familyname fontname filename subfont instances
xcharterbold xcharter xcharterbold XCharter-Bold.otf xcharterbolditalic xcharter xcharterbolditalic XCharter-BoldItalic.otf xcharterboldslanted xcharter xcharterboldslanted XCharter-BoldSlanted.otf xcharteritalic xcharter xcharteritalic XCharter-Italic.otf xchartermath xchartermath xchartermath XCharter-Math.otf xchartermathbold xchartermathbold xchartermathbold XCharter-Math-Bold.otf xchartermathmedium xchartermath xchartermath XCharter-Math.otf xchartermathregular xchartermath xchartermath XCharter-Math.otf xcharternormal xcharter xcharteritalic XCharter-Italic.otf xcharterregular xcharter xcharterroman XCharter-Roman.otf xcharterroman xcharter xcharterroman XCharter-Roman.otf xcharterslanted xcharter xcharterslanted XCharter-Slanted.otf
and as you can see there is no entry "xcharter". In your case context loaded the bold version of the font but when you use "xcharterroman" as name the document shows the normal upright version.
- Overpass has a glyph for the ae ligature. Is it normal that it is not used as a ligature for ae? This seems to be a stupid decision to replace ae by default with a ligature, maybe dependent on the language but not for all of them. Ok, I've seen it here as (somewhat) common ligature: https://en.wikipedia.org/wiki/Ligature_(writing)#Computer_typesetting But there is also mentioned that TeX just has ff, fi, fl, ffi and ffl by default.
What is available or not depends on the font and even then there can be differences between different version of a font.
Wolfgang
participants (2)
-
Gerion Entrup
-
Wolfgang Schuster