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

Support for OpenType Variable Fonts #321

Open
SFr682k opened this issue Mar 5, 2018 · 5 comments
Open

Support for OpenType Variable Fonts #321

SFr682k opened this issue Mar 5, 2018 · 5 comments

Comments

@SFr682k
Copy link

SFr682k commented Mar 5, 2018

Version 1.8 of the OpenType font format specification introduced Variable Fonts and Adobe's Source * Pro fonts using this mechanisms are already available (see the "Releases" section of the GitHub repos) and more fonts using this mechanisms may follow soon.
Using this approach it would be possible to allow arbitrary selection of font weight and (optical) font size.

Will fontspec implement mechanisms supporting OT Variable Fonts?

@wspr
Copy link
Collaborator

wspr commented Mar 5, 2018 via email

@KrasnayaPloshchad
Copy link

I suggest report to upstream:
https://sourceforge.net/p/xetex/_list/tickets

@lordsutch
Copy link

According to upstream in latex3/luaotfload#120, the default node shaper in luaotfload now supports variable fonts as of version 3.16, so fontspec may be able to utilize it.

@edward-martyr
Copy link

It already works under lualatex:

% !TEX program = lualatex

\documentclass{article}

\usepackage{forloop}
\usepackage{fontspec}
\setmainfont{Hundred.ttf} %https://github.com/edward-martyr/Hundred-ASCII/blob/master/Hundred.ttf

\begin{document}

\newcounter{themenumber}
\forloop{themenumber}{20}{\value{themenumber} < 101}{{\addfontfeatures{RawFeature={+axis={wght=\arabic{themenumber}}}}a}}

\end{document}

Result:
スクリーンショット 2021-02-06 17 47 58

@callegar
Copy link

There seems to be an issue in picking the correct default values for the font axes:

for instance

\documentclass[a4paper,12pt]{article}
\usepackage{fontspec}
\setmainfont{Source Serif 4 Variable}
\begin{document}
The quick brown fox jumps over the lazy dog.
\end{document}

fails, unless you add a

\defaultfontfeatures{RawFeature={+axis={wght=100}}}

before the \setmainfont.

However, if I am correct, the font fvar table should list a default value for every axis. Another thing that is unclear to me is the following. The font that I have used as an example above has two axes: weight and optical size. The need to explicitly specify a font feature seems to exist only for the weight. Why?

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

6 participants