latex3 / fontspec

Font selection in LaTeX for XeTeX and LuaTeX
http://latex3.github.io/fontspec/
LaTeX Project Public License v1.3c
273 stars 33 forks source link

Local vs global: \fontspec_set_family:Nnn etc #316

Open wspr opened 6 years ago

wspr commented 6 years ago

Should functions like \fontspec_set_family:Nnn be always local, always global, or have gset variants?

eg9 commented 6 years ago

If you say

\font\foo=cmr17

in legacy TeX, the font is loaded globally, so a new declaration for it will not load it again; but the assignment to the font selection command will respect grouping. Since

\global\font\foo=cmr17

is legal and will assign the font selection command globally. So perhaps both local and global variants could be provided, although I'd deprecate defining font families inside document.

Anyhow, if you decide that the function acts globally, its name should be with gset to make the action clear.

wspr commented 6 years ago

Yes, it’s not entirely clear at first look which is needed. I wanted to do some checks with plain NFSS and see what’s most natural to fit in with that (but ran out of time, hence the issue to remind me).

If I went with “global only” I’d probably change the name to \fontspec_new_family:Nnn with a check.

wspr commented 5 years ago

I definitely need to provide both variants.