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