Difference between revisions of "Command/setupfontexpansion"

From Wiki
Jump to navigation Jump to search
(new)
 
(more details)
 
Line 7: Line 7:
 
   <cd:arguments>
 
   <cd:arguments>
 
     <cd:keywords ordinal="1">
 
     <cd:keywords ordinal="1">
     <cd:keywordsdoc></cd:keywordsdoc>
+
     <cd:keywordsdoc>name of an expansion preset</cd:keywordsdoc>
 
     <cd:constant type="cd:name"></cd:constant>
 
     <cd:constant type="cd:name"></cd:constant>
 
     </cd:keywords>
 
     </cd:keywords>
Line 13: Line 13:
 
     <cd:assignmentsdoc></cd:assignmentsdoc>
 
     <cd:assignmentsdoc></cd:assignmentsdoc>
 
     <cd:parameter name="vector">
 
     <cd:parameter name="vector">
       <cd:paramdoc>always "quality", a combination of "alpha" and "punctuation", see {{src|font-imp-quality.lua}}</cd:paramdoc>
+
       <cd:paramdoc>set of affected characters; always "default"="quality", a combination of "alpha" and "punctuation", see {{src|font-imp-quality.lua}}</cd:paramdoc>
 
       <cd:constant type="cd:name"></cd:constant>
 
       <cd:constant type="cd:name"></cd:constant>
 
     </cd:parameter>
 
     </cd:parameter>
 
     <cd:parameter name="factor">
 
     <cd:parameter name="factor">
       <cd:paramdoc></cd:paramdoc>
+
       <cd:paramdoc>(default = 1)</cd:paramdoc>
 
       <cd:constant type="cd:number"></cd:constant>
 
       <cd:constant type="cd:number"></cd:constant>
 
     </cd:parameter>
 
     </cd:parameter>
 
     <cd:parameter name="stretch">
 
     <cd:parameter name="stretch">
       <cd:paramdoc></cd:paramdoc>
+
       <cd:paramdoc>amount of stretching (default = 2)</cd:paramdoc>
 
       <cd:constant type="cd:number"></cd:constant>
 
       <cd:constant type="cd:number"></cd:constant>
 
     </cd:parameter>
 
     </cd:parameter>
 
     <cd:parameter name="shrink">
 
     <cd:parameter name="shrink">
       <cd:paramdoc></cd:paramdoc>
+
       <cd:paramdoc>amount of shrinking (default = 2)</cd:paramdoc>
 
       <cd:constant type="cd:number"></cd:constant>
 
       <cd:constant type="cd:number"></cd:constant>
 
     </cd:parameter>
 
     </cd:parameter>
 
     <cd:parameter name="step">
 
     <cd:parameter name="step">
       <cd:paramdoc></cd:paramdoc>
+
       <cd:paramdoc>granularity (default = 0.5)</cd:paramdoc>
 
       <cd:constant type="cd:number"></cd:constant>
 
       <cd:constant type="cd:number"></cd:constant>
 
     </cd:parameter>
 
     </cd:parameter>
Line 38: Line 38:
 
<cd:description>According to the manual, there are two presets, "preset" and "quality".
 
<cd:description>According to the manual, there are two presets, "preset" and "quality".
  
 
+
    name     vector step factor stretch shrink
{|
+
    preset           0.50 1.00   2       2
! name   !! vector !! step !! factor !! stretch !! shrink
+
    quality default 0.50 1.00   2       2
| -
 
| preset ||        || 0.50 || 1.00 || 2 || 2
 
| -
 
| quality || default || 0.50 || 1.00 || 2 || 2
 
|}
 
 
 
  
 
“The smaller the step, the more instances of a font we get, the better it looks, and the
 
“The smaller the step, the more instances of a font we get, the better it looks, and the
Line 56: Line 50:
 
<cd:source file="hand-ini.mkiv" originator="system"></cd:source>
 
<cd:source file="hand-ini.mkiv" originator="system"></cd:source>
 
<cd:wikipage originator="system" page="Category:Fonts"></cd:wikipage>
 
<cd:wikipage originator="system" page="Category:Fonts"></cd:wikipage>
 +
<cd:manual pdf="fonts-mkiv.pdf"></cd:manual>
 +
<cd:source file="font-imp-quality.lua"></cd:source>
 
<cd:commandref name="definefontfeature"></cd:commandref>
 
<cd:commandref name="definefontfeature"></cd:commandref>
<cd:manual pdf="fonts-mkiv.pdf"></cd:manual>
+
<cd:commandref name="showfontexpansion">for debugging</cd:commandref>
<cd:source file="font-imp-quality.lua"></cd:source></cd:seealso>
+
<cd:commandref name="noexpansion">disable expansion locally</cd:commandref></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Latest revision as of 08:40, 14 May 2023


\setupfontexpansion

Summary

The command \setupfontexpansion is used to define a set of font expansion (hz) parameters

Settings

\setupfontexpansion[...][...=...,...]
[...]name
vectorname
factornumber
stretchnumber
shrinknumber
stepnumber

OptionExplanation
name of an expansion preset
vector
set of affected characters; always "default"="quality", a combination of "alpha" and "punctuation", see font-imp-quality.lua
factor
(default = 1)
stretch
amount of stretching (default = 2)
shrink
amount of shrinking (default = 2)
step
granularity (default = 0.5)

Description

According to the manual, there are two presets, "preset" and "quality".
   name     vector  step factor stretch shrink
   preset           0.50 1.00   2       2
   quality  default 0.50 1.00   2       2

“The smaller the step, the more instances of a font we get, the better it looks, and the larger the files become. It’s best not to use too many stretch and shrink steps. A stretch of 2 and shrink of 2 and step of .25 results in up to 8 instances plus the regular sized one.”

Examples

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: