More flexible features #26
Merged
Conversation
|
Looks very interesting. I will merge tomorrow, it is too late now. Do you have an idea for some new "mode" that could be used for tests (until something real comes up from the harfbuzz stuff)? |
|
@u-fischer The
fonts.readers.plain = function(spec)
local f = font.read_tfm(spec.forcedname or spec.name, spec.size)
local s = spec.features.raw.slant
if s then
f.slant = tonumber(s)
end
local b = spec.features.raw.bold
if b then
f.mode = 2
f.width = tonumber(b)
end
return f
endExample: \documentclass{article}
\directlua{require'plain_mode'}
\font\cmrfont"cmr10:mode=plain;slant=1000;bold=500"
\begin{document}
abc\cmrfont def
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Depends on #25. Be less restrictive when parsing feature specifiers.
Especially when loading Lua fonts or when using custom modes, the "features" might not be features in a OpenType sense. Then we might not want to limit the characters usable in the "feature" values more than necessary.
For lua-fonts this allows using the "features" as a general argument passing interface:
Example (assuming the existence of an appropriate
apply_featurefile.lua):The text was updated successfully, but these errors were encountered: