[XeTeX] Coloured fonts
Paul A. Norman
paul at paulanorman.info
Fri Mar 19 00:50:32 CET 2021
If a pdf (pre)viewer component is not coded to do it by itself, the underlying operating system may be called to do the rendering.
As per link in Ross More's posting, that may mean sometimes that a minimum of:
macOS 10.14+, iOS 12+, Windows 10+
– is required.
It's one thing to get it showing in a pdf, it's quite another sometimes to get it into print ...
"OpenType SVG Fonts in Print: Known Issues and Recommendations
by Laura Baker
"OpenType SVG (scalable vector graphics) fonts are nothing new. Initially intended for web-based design, OpenType SVG fonts are beginning to appear in printed works and are causing concern in the printing industry among designers, publishers, printers, and software companies alike.
..."
Here's a workout for anyone interested, as it also has tools for outputting the SVG table and so for inspection of the colour 'glyphs' directly if necessary for some fonts ...
"Tools and sample files for making OpenType-SVG fonts"
MIT License
addsvg – adds an SVG table to a font, using SVG files provided. The font's format can be either OpenType or TrueType.
dumpsvg – saves the contents of a font's SVG table as individual SVG files. The font's format can be either OpenType, TrueType, WOFF, or WOFF2.
fonts2svg – generates a set of SVG glyph files from one or more fonts and hex colors for each of them. The fonts' format can be either OpenType, TrueType, WOFF, or WOFF2.
With process instructions under —
"How to make OpenType-SVG fonts?"
https://github.com/adobe-type-tools/opentype-svg
---
http://PaulANorman.info
On March 19, 2021 10:44:57 AM GMT+13:00, Philip Taylor <P.Taylor at Hellenic-Institute.Uk> wrote:
>David Carlisle wrote:
>
>> I see colour here in windows firefox, widows chrome and xpdf using
>> cygwin X
>>
>> attached luahbtex file and result
>>
>> in Chrome it looks like this
>>
>> image.png
>>
>>
>
>OK, so it could be the TeXworks previewer that is failing to shew the
>colour. But to get your plain LuaTeX code to work, and not report a
>missing font, I had to remove the ".ttf" extension :
>
>% !TeX Program=LuaTeX
>
>\magnification 900
>
>\input luaotfload.sty
>
>\font \bodyfont = "Minion Pro"
>\font \tenit = "MinionPro-IT"
>\font \smallcaps = "Minion Pro/ICU:+smcp"
>\font \oldstyle = "Minion Pro/ICU:+onum"
>\relax
>\font \pieces = "BabelStoneXiangqiColour:mode=harf"
>\relax
>\pagewidth = 35 true pc
>\pageheight = 59 true pc
>\hsize = 25 true pc
>\advance \hoffset by -1 true in
>\advance \voffset by -1 true in
>\advance \hoffset by 5 pc
>\advance \voffset by 13 true pc
>\pretolerance = 9999
>\spaceskip = 0,333 em plus 0,3 em minus 0,1 em
>\xspaceskip = 1 em plus 0,3 em minus 0,1 em
>\def \lineturn {\unskip {\parfillskip = 0 pt \endgraf
>\noindent}\ignorespaces}
>\def \ignore #1{}
>\catcode `\“ = \active
>\catcode `\” = \active
>\catcode `\; = \active
>\catcode `\: = \active
>\def \Prespace #1{\def #1{$\;$\char `#1\relax}}
>\def \prespace #1{\def #1{$\,$\char `#1\relax}}
>\def \postspace #1{\def #1{\char `#1\relax $\,$}}
>\prespace ”
>\Prespace ;
>\Prespace :
>\postspace “
>\bodyfont
>\parskip = 0 pt
>
>% snip
>
>\pieces
>\centerline {\char "1FA60\relax}
>\centerline {🩠}
>
>\end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/xetex/attachments/20210319/ddd28595/attachment-0001.html>
More information about the XeTeX
mailing list.