I’m trying to describe the "factor" parameter.

According to the reference (i.e. interface), factor can become:
fit broad max auto default
In the source (grph-trf.mk*), there’s also "min".

- "broad" fails with a "missing )", see below.
- I don’t see a difference between "max" and "fit" (both just use the max height and ignore the max width). - "min" fills the defined max space ignoring the ration and thus distorting the image.
- "auto" keeps the ratio and scales the image down into the max space.
- There’s no option that uses the defined space and crops the image into it; maybe "broad" is meant to do that?


"""
\setupexternalfigures[
  location=default,
  frame=on,
  maxwidth=5cm,
  maxheight=5cm,
]

\starttext

\startcombination[2*4]
{\externalfigure[hacker][factor=max]} {max}
{\externalfigure[mill]  [factor=max]} {max}
{\externalfigure[hacker][factor=fit]} {fit}
{\externalfigure[mill]  [factor=fit]} {fit}
{\externalfigure[hacker][factor=min]} {min}
{\externalfigure[mill]  [factor=min]} {min}
{\externalfigure[hacker][factor=auto]} {auto}
{\externalfigure[mill]  [factor=auto]} {auto}
%{\externalfigure[hacker][factor=broad]} {broad}
%{\externalfigure[mill]  [factor=broad]} {broad}
\stopcombination

\stoptext
"""



! Missing ) inserted for expression
tex error       > tex error on line 1 in file de/_tests/figurefactor.tex:

<to be read again>

    b
<macro> \m_grph_scale_factor_set
    b
    odyfont
<macro> \692>broad
#1#-#-#-#2->\global #1{#2-(\externalfigureparameter \c!bodyfont \c!bodyfont
    )*4}
<macro> \m_grph_scale_factor_set
\grph_scale_apply_size \ifdim \d_grph_scale_x_size >\d_grph_scale_y_size \grph_scale_calculate_norm \d_grph_scale_used_x_size \p_factor \p_maxwidth \hsize \d_grph_scale_h_size \grph_scale_calculate_scales \d_grph_scale_used_x_size \d_grph_scale_x_siz
<macro> \p_maxheight
    \ifinset \p_factor \m_grph_scale_factor_set \grph_scale_by_factor_a
\orelse \ifinset \p_hfactor \m_grph_scale_factor_set \grph_scale_by_factor_b \orelse \ifinset \p_wfactor \m_grph_scale_factor_set \grph_scale_by_factor_c \else \grph_scale_by_factor_
<macro> \m_grph_scale_stamp_b
... \let \m_grph_scale_used_x_scale \!!plusone \let \m_grph_scale_used_y_scale \!!plusone \c_grph_scale_scaling_done \conditionalfalse \grph_scale_check_parameters \ifconditional \c_grph_scale_scaling_done \else \grph_scale_by_factor
    \fi \ifcondit ...
 ...

<line 3.25>
    {\externalfigure[hacker][factor=broad]}
     {broad}

 1 >>
 2
 3     \setupexternalfigures[
 4       location=default,
 5       frame=on,
 6       maxwidth=5cm,
 7       maxheight=5cm,
 8     ]
 9
10     \starttext
11
I was expecting to see an operator or ')' but didn't.

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to