Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion option? #1

Open
jsbien opened this issue Jul 9, 2021 · 6 comments
Open

Discussion option? #1

jsbien opened this issue Jul 9, 2021 · 6 comments

Comments

@jsbien
Copy link

jsbien commented Jul 9, 2021

Hi! What about switching on the discussion option? I have some questions about using the font in XeLaTeX (the color doesn't work out of the box).

@psb1558
Copy link
Owner

psb1558 commented Jul 12, 2021

Sorry I've been a bit out of touch. I'd rather not turn on discussion, since traffic there would be almost nonexistent. I think it would be appropriate to discuss it here.

A preliminary remark: I haven't been able to find any indication that TeX supports color fonts at all. (The issue is difficult to search because search engines can't easily distinguish between "color fonts in TeX" and (say) "changing the color of fonts in TeX.") One could ask an expert, I suppose. Someone may have something in progress, but you know about the pace of development in the TeX world.

Probably the solution for TeX would be to create a layered font. That's actually a small set of fonts, one for each color. You have to double-print, positioning one exactly on top of the other(s) and set the colors manually. Obviously more difficult to use than a COLR/CPAL or SVG font, but you get a little more flexibility (you can choose your own colors).

Years ago I created a (sort of) layer font to accompany my Eadui font. Once the font was done, it turned out to be not terribly difficult to use in LaTeX, by creating a command that used \llap (with three parameters, one for the text and two for colors):

\newcommand{\filltext}[3]{{\fontspec{EaduiFill}\color{#1}#3}%
\llap{\fontspec{Eadui}\color{#2}#3}}

At any rate, if there's any interest in layer fonts for Cerne, I'll be glad to create them.

@jsbien
Copy link
Author

jsbien commented Jul 13, 2021

I wanted to use it just for fun, so it is not an important question for me.
I found a quite recent (March) thread about BabelStone Xiangqi Colour font on the XeTeX list.
If I understand correctly, LuaTeX should be able to handle it.
I will try to adapt the Xiangqi Colour example and let you know.

@jsbien
Copy link
Author

jsbien commented Jul 13, 2021

Do you see the colors in the enclosed PDF? I do not not.
Update: just a stupid mistake of mine.

@psb1558
Copy link
Owner

psb1558 commented Jul 13, 2021

I don't either. Was it supposed to be Cerne? The only font in it is Computer Modern. Programs that don't know about color fonts are supposed to treat it like a conventional font, but who knows? It looks like LuaTeX is substituting a default font for one that confuses it.

Lua is generally out front. If any TeX flavor supports color fonts, it will.

@jsbien
Copy link
Author

jsbien commented Jul 13, 2021

It works! However at the moment luahbtex is available only in Debian testing.
luahbtex.zip

@psb1558
Copy link
Owner

psb1558 commented Jul 13, 2021

Excellent! Wha's in testing now will be in release a little way down the road—and the good thing about the slow TeX development pipeline is that things tend to actually work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants