Hi Max,
The internal "pack_result_tagged" function that you added for potraceing
seems to be useful beyond bitmapped fonts, because it lets you
manipulate arbitrary CFF outlines from Lua. As far as I'm aware, this
makes ConTeXt the only program that can modify and create non-Type 3
fonts while generating a document.
Well, I could add some more interfacing there. I think i must have some
experimental code related to virrtual fonts somewhere.
This seems to be quite useful for a better fake bold. The traditional
PDF method of applying a thin stroke to characters can have some
rendering issues and doesn't give you very much control, but with
"pack_result_tagged", we can make a "real" fake bold font where the font
itself has been emboldened (versus just applying a PDF effect). This
also gives us unlimited control, so it should theoretically be possible
to replicate FontForge's very good bold/italicizing algorithms to get
much better results than you can get from PDF effects.
I've attached a very hacky demonstration that needs to be compiled with
MkIV (despite using LMTX-only features). The offsetting algorithm isn't
quite correct around straight lines, but it's still a fairly neat demo.
There are quite some artifacts if you zoom in, so the question is then,
how reliable can one do arbitrary fonts. I need to check out FF for this.
setupbodyfont[pagella, 12pt]
\define\SampleText{The quick brown fox jumps over the lazy dog.}
\definefontfeature[oldfakeboldA][weight=.20] % effect={width=0.45}]
\definefontfeature[oldfakeboldB][weight=.35]
\definefont[oldfakeboldA][file:texgyrepagella-regular.otf*default,oldfakeboldA
@ 12pt]
\definefont[oldfakeboldB][file:texgyrepagella-regular.otf*default,oldfakeboldB
@ 12pt]
\startTEXpage[offset=1ex]
\setupTABLE[column][1][align=flushright, style=tt]
\setupTABLE[column][2][align=flushleft, loffset=1em]
\startTABLE[frame=off]
\NC Regular \NC \tf \SampleText \NC\NR
\NC Real Bold \NC \bf \SampleText \NC\NR
\NC Fake Bold B \NC \oldfakeboldB \glyphxscale 975 \glyphyscale
975 \SampleText \NC \NR
\NC Fake Bold A \NC \oldfakeboldA \SampleText \NC\NR
\stopTABLE
\stopTEXpage
It is interesting to see some differences in design, take the k. SO we
can never match the 'intended real old'.
Thanks for trying,
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________