Re: [NTG-context] \getscaledglyph for width-only

2016-08-20 Thread Hans Hagen

On 8/18/2016 6:30 PM, Brian R. Landy wrote:



On Thu, 18 Aug 2016, Hans Hagen wrote:


On 8/18/2016 1:12 AM, Brian R. Landy wrote:



On Aug 17, 2016, at 5:45 PM, Hans Hagen  wrote:

On 8/17/2016 9:56 PM, Brian R. Landy wrote:

Hi, I was wondering if there is a way to call \getscaledglyph to
scale a
glyph only horizontally, leaving the height untouched?  Or maybe an
alternate command?

I can sort of accomplish this with (for example)
\scale[sx=0.75,sy=1.0]{}{A}, but that encloses the glyph in an \hbox,
which can be problematic.  \getscaledglyph doesn't cause me any
problems, except that it scales the height too.


\starttext

\definefontfeature[whatever][default][extend=2.5]

\definedfont[Serif*whatever at 12pt]

whatever

\stoptext



Thank you.  One thing that \getscaledglyph does it works agnostic to
the currently selected font.  For example:


scaling glyphs in one direction is kind of bad anyway so if you want
just one glyph you can do

\inframed{\scale[width=3em,height=1ex]{...}}

or whatever suits the purpose


Agreed.  Here's a little more background, so it makes some sense why I
want to scale horizontally, and then I describe my final solution.  I
have a specific case where I use a minus, a hyphen-minus, and a plus
close to each other, and it's always bugged me that most fonts don't
vertically align the hyphen-minus with the other two glyphs. An example is:

  {\normalUchar"2212}100-00+

I was thinking that math fonts did align these symbols, hence my
question on Monday on how to get the hyphen-minus in math mode (and
thanks for the quick answer on that) but unfortunately was wrong.  So
that got me searching for a way to horizontally shrink a minus, so it
would retain the same height and line thickness as the minus.
Horizontal-only scaling of a hyphen/dash/minus isn't so bad.

\scaled[] worked perfectly, but it breaks inside a natural table with
character alignment enabled.  I have a commented example of this below.
\getscaledglyph works in the table, but the vertical shrink is a
non-starter.

Here's an example:

\edef\mathminus{\normalUchar"2212}
\edef\smallminus{\getscaledglyph{0.33}{}{\normalUchar"2212}}
\starttext

This is my starting point:

\bTABLE[aligncharacter=yes,alignmentcharacter={text->-}]
\bTR \bTD \mathminus100-00+ \eTD \eTR
\bTR \bTD   100-00  \eTD \eTR
\bTR \bTD \mathminus 99-00+ \eTD \eTR
\bTR \bTD \mathminus 99-00  \eTD \eTR
\eTABLE

% This table won't typeset:
%
% \bTABLE[aligncharacter=yes,alignmentcharacter={text->:}]
% \bTR \bTD \mathminus100\scaled[sx=0.5,sy=1.0]{\mathminus}00:+ \eTD \eTR
% \bTR \bTD   100\scaled[sx=0.5,sy=1.0]{\mathminus}00:  \eTD \eTR
% \bTR \bTD \mathminus 99\scaled[sx=0.5,sy=1.0]{\mathminus}00:+ \eTD \eTR
% \bTR \bTD \mathminus 99\scaled[sx=0.5,sy=1.0]{\mathminus}00:  \eTD \eTR
% \eTABLE

\stoptext

But I came up with a solution that works.  Rather than attempt to shrink
the minus glyph, I define a new glyph that corrects the height of the
hyphen-minus:

\startluacode
 local function addsmallminus(tfmdata)
 local hchar= tfmdata.characters[0x002D]
 local mchar= tfmdata.characters[0x2212]
 tfmdata.characters[0xFE000]   = {
 width= hchar.width,
 height   = mchar.height,
 commands = {
 { "down", hchar.height-mchar.height },
 { "char", 0x002D },
 }
 }
 end

 fonts.constructors.newfeatures("otf").register {
 name= "smallminus",
 description = "small minus",
 manipulators = {
 base = addsmallminus,
 node = addsmallminus,
 }
 }

\stopluacode

\definefontfeature[default][default][smallminus=yes]
\edef\smallminus{\normalUchar"FE000}

\starttext

\bTABLE[aligncharacter=yes,alignmentcharacter={text->\smallminus}]
\bTR \bTD \mathminus100\smallminus00+ \eTD \eTR
\bTR \bTD   100\smallminus00  \eTD \eTR
\bTR \bTD \mathminus 99\smallminus00+ \eTD \eTR
\bTR \bTD \mathminus 99\smallminus00  \eTD \eTR
\eTABLE

\stoptext

So this looks good and works with any font.  The only issue is fonts
that use a different line thickness for the minus and hyphen-minus; this
top-aligns the glyphs.

Is there a way to make this glyph available in math-mode?  I get a "?"
when I try:

\math{\smallminus}
\math{\mathchar"FE000}

Thanks for all your help!


One problem with your approach is that you can never know if that 
private slot isn't already used. This can be avoided with


\startluacode
local function addsmallminus(tfmdata)
local hchar = tfmdata.characters[0x002D]
local mchar = tfmdata.characters[0x2212]
if hchar and mchar then
fonts.helpers.addprivate(tfmdata, "smallminus", {
width= hchar.width,
height   = mchar.height,
commands = {
{ "down", hchar.height - mchar.height },
{ "char", 0x002D },
}

Re: [NTG-context] \getscaledglyph for width-only

2016-08-18 Thread Hans Hagen

On 8/18/2016 6:30 PM, Brian R. Landy wrote:



On Thu, 18 Aug 2016, Hans Hagen wrote:


On 8/18/2016 1:12 AM, Brian R. Landy wrote:



On Aug 17, 2016, at 5:45 PM, Hans Hagen  wrote:

On 8/17/2016 9:56 PM, Brian R. Landy wrote:

Hi, I was wondering if there is a way to call \getscaledglyph to
scale a
glyph only horizontally, leaving the height untouched?  Or maybe an
alternate command?

I can sort of accomplish this with (for example)
\scale[sx=0.75,sy=1.0]{}{A}, but that encloses the glyph in an \hbox,
which can be problematic.  \getscaledglyph doesn't cause me any
problems, except that it scales the height too.


\starttext

\definefontfeature[whatever][default][extend=2.5]

\definedfont[Serif*whatever at 12pt]

whatever

\stoptext



Thank you.  One thing that \getscaledglyph does it works agnostic to
the currently selected font.  For example:


scaling glyphs in one direction is kind of bad anyway so if you want
just one glyph you can do

\inframed{\scale[width=3em,height=1ex]{...}}

or whatever suits the purpose


Agreed.  Here's a little more background, so it makes some sense why I
want to scale horizontally, and then I describe my final solution.  I
have a specific case where I use a minus, a hyphen-minus, and a plus
close to each other, and it's always bugged me that most fonts don't
vertically align the hyphen-minus with the other two glyphs. An example is:

  {\normalUchar"2212}100-00+

I was thinking that math fonts did align these symbols, hence my
question on Monday on how to get the hyphen-minus in math mode (and
thanks for the quick answer on that) but unfortunately was wrong.  So
that got me searching for a way to horizontally shrink a minus, so it
would retain the same height and line thickness as the minus.
Horizontal-only scaling of a hyphen/dash/minus isn't so bad.

\scaled[] worked perfectly, but it breaks inside a natural table with
character alignment enabled.  I have a commented example of this below.
\getscaledglyph works in the table, but the vertical shrink is a
non-starter.

Here's an example:

\edef\mathminus{\normalUchar"2212}
\edef\smallminus{\getscaledglyph{0.33}{}{\normalUchar"2212}}
\starttext

This is my starting point:

\bTABLE[aligncharacter=yes,alignmentcharacter={text->-}]
\bTR \bTD \mathminus100-00+ \eTD \eTR
\bTR \bTD   100-00  \eTD \eTR
\bTR \bTD \mathminus 99-00+ \eTD \eTR
\bTR \bTD \mathminus 99-00  \eTD \eTR
\eTABLE

% This table won't typeset:
%
% \bTABLE[aligncharacter=yes,alignmentcharacter={text->:}]
% \bTR \bTD \mathminus100\scaled[sx=0.5,sy=1.0]{\mathminus}00:+ \eTD \eTR
% \bTR \bTD   100\scaled[sx=0.5,sy=1.0]{\mathminus}00:  \eTD \eTR
% \bTR \bTD \mathminus 99\scaled[sx=0.5,sy=1.0]{\mathminus}00:+ \eTD \eTR
% \bTR \bTD \mathminus 99\scaled[sx=0.5,sy=1.0]{\mathminus}00:  \eTD \eTR
% \eTABLE

\stoptext

But I came up with a solution that works.  Rather than attempt to shrink
the minus glyph, I define a new glyph that corrects the height of the
hyphen-minus:

\startluacode
 local function addsmallminus(tfmdata)
 local hchar= tfmdata.characters[0x002D]
 local mchar= tfmdata.characters[0x2212]
 tfmdata.characters[0xFE000]   = {
 width= hchar.width,
 height   = mchar.height,
 commands = {
 { "down", hchar.height-mchar.height },
 { "char", 0x002D },
 }
 }
 end

 fonts.constructors.newfeatures("otf").register {
 name= "smallminus",
 description = "small minus",
 manipulators = {
 base = addsmallminus,
 node = addsmallminus,
 }
 }

\stopluacode

\definefontfeature[default][default][smallminus=yes]
\edef\smallminus{\normalUchar"FE000}

\starttext

\bTABLE[aligncharacter=yes,alignmentcharacter={text->\smallminus}]
\bTR \bTD \mathminus100\smallminus00+ \eTD \eTR
\bTR \bTD   100\smallminus00  \eTD \eTR
\bTR \bTD \mathminus 99\smallminus00+ \eTD \eTR
\bTR \bTD \mathminus 99\smallminus00  \eTD \eTR
\eTABLE

\stoptext

So this looks good and works with any font.  The only issue is fonts
that use a different line thickness for the minus and hyphen-minus; this
top-aligns the glyphs.

Is there a way to make this glyph available in math-mode?  I get a "?"
when I try:


method 1:

\definefontfeature[math-text] [math-text] [smallminus=yes]
\definefontfeature[math-script]   [math-script]   [smallminus=yes]
\definefontfeature[math-scriptscript] [math-scriptscript] [smallminus=yes]

method 2: (no need to adapt features)

 name= "smallminus",
 description = "small minus",
 default = true,



\math{\smallminus}
\math{\mathchar"FE000}

Thanks for all your help!


Brian
___

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

maillist : ntg-context@ntg.nl /

Re: [NTG-context] \getscaledglyph for width-only

2016-08-18 Thread Brian R. Landy



On Thu, 18 Aug 2016, Hans Hagen wrote:


On 8/18/2016 1:12 AM, Brian R. Landy wrote:



On Aug 17, 2016, at 5:45 PM, Hans Hagen  wrote:

On 8/17/2016 9:56 PM, Brian R. Landy wrote:
Hi, I was wondering if there is a way to call \getscaledglyph to 
scale a

glyph only horizontally, leaving the height untouched?  Or maybe an
alternate command?

I can sort of accomplish this with (for example)
\scale[sx=0.75,sy=1.0]{}{A}, but that encloses the glyph in an 
\hbox,

which can be problematic.  \getscaledglyph doesn't cause me any
problems, except that it scales the height too.


\starttext

\definefontfeature[whatever][default][extend=2.5]

\definedfont[Serif*whatever at 12pt]

whatever

\stoptext



Thank you.  One thing that \getscaledglyph does it works agnostic to 
the currently selected font.  For example:


scaling glyphs in one direction is kind of bad anyway so if you want 
just one glyph you can do


\inframed{\scale[width=3em,height=1ex]{...}}

or whatever suits the purpose


Agreed.  Here's a little more background, so it makes some sense why I 
want to scale horizontally, and then I describe my final solution.  I 
have a specific case where I use a minus, a hyphen-minus, and a plus 
close to each other, and it's always bugged me that most fonts don't 
vertically align the hyphen-minus with the other two glyphs. An example 
is:


  {\normalUchar"2212}100-00+

I was thinking that math fonts did align these symbols, hence my 
question on Monday on how to get the hyphen-minus in math mode (and 
thanks for the quick answer on that) but unfortunately was wrong.  So 
that got me searching for a way to horizontally shrink a minus, so it 
would retain the same height and line thickness as the minus. 
Horizontal-only scaling of a hyphen/dash/minus isn't so bad.


\scaled[] worked perfectly, but it breaks inside a natural table with 
character alignment enabled.  I have a commented example of this below. 
\getscaledglyph works in the table, but the vertical shrink is a 
non-starter.


Here's an example:

\edef\mathminus{\normalUchar"2212}
\edef\smallminus{\getscaledglyph{0.33}{}{\normalUchar"2212}}
\starttext

This is my starting point:

\bTABLE[aligncharacter=yes,alignmentcharacter={text->-}]
\bTR \bTD \mathminus100-00+ \eTD \eTR
\bTR \bTD   100-00  \eTD \eTR
\bTR \bTD \mathminus 99-00+ \eTD \eTR
\bTR \bTD \mathminus 99-00  \eTD \eTR
\eTABLE

% This table won't typeset:
%
% \bTABLE[aligncharacter=yes,alignmentcharacter={text->:}]
% \bTR \bTD \mathminus100\scaled[sx=0.5,sy=1.0]{\mathminus}00:+ \eTD \eTR
% \bTR \bTD   100\scaled[sx=0.5,sy=1.0]{\mathminus}00:  \eTD \eTR
% \bTR \bTD \mathminus 99\scaled[sx=0.5,sy=1.0]{\mathminus}00:+ \eTD \eTR
% \bTR \bTD \mathminus 99\scaled[sx=0.5,sy=1.0]{\mathminus}00:  \eTD \eTR
% \eTABLE

\stoptext

But I came up with a solution that works.  Rather than attempt to shrink 
the minus glyph, I define a new glyph that corrects the height of the 
hyphen-minus:


\startluacode
 local function addsmallminus(tfmdata)
 local hchar= tfmdata.characters[0x002D]
 local mchar= tfmdata.characters[0x2212]
 tfmdata.characters[0xFE000]   = {
 width= hchar.width,
 height   = mchar.height,
 commands = {
 { "down", hchar.height-mchar.height },
 { "char", 0x002D },
 }
 }
 end

 fonts.constructors.newfeatures("otf").register {
 name= "smallminus",
 description = "small minus",
 manipulators = {
 base = addsmallminus,
 node = addsmallminus,
 }
 }

\stopluacode

\definefontfeature[default][default][smallminus=yes]
\edef\smallminus{\normalUchar"FE000}

\starttext

\bTABLE[aligncharacter=yes,alignmentcharacter={text->\smallminus}]
\bTR \bTD \mathminus100\smallminus00+ \eTD \eTR
\bTR \bTD   100\smallminus00  \eTD \eTR
\bTR \bTD \mathminus 99\smallminus00+ \eTD \eTR
\bTR \bTD \mathminus 99\smallminus00  \eTD \eTR
\eTABLE

\stoptext

So this looks good and works with any font.  The only issue is fonts 
that use a different line thickness for the minus and hyphen-minus; this 
top-aligns the glyphs.


Is there a way to make this glyph available in math-mode?  I get a "?" 
when I try:


\math{\smallminus}
\math{\mathchar"FE000}

Thanks for all your help!


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \getscaledglyph for width-only

2016-08-18 Thread Hans Hagen

On 8/18/2016 1:12 AM, Brian R. Landy wrote:



On Aug 17, 2016, at 5:45 PM, Hans Hagen  wrote:

On 8/17/2016 9:56 PM, Brian R. Landy wrote:

Hi, I was wondering if there is a way to call \getscaledglyph to scale a
glyph only horizontally, leaving the height untouched?  Or maybe an
alternate command?

I can sort of accomplish this with (for example)
\scale[sx=0.75,sy=1.0]{}{A}, but that encloses the glyph in an \hbox,
which can be problematic.  \getscaledglyph doesn't cause me any
problems, except that it scales the height too.


\starttext

\definefontfeature[whatever][default][extend=2.5]

\definedfont[Serif*whatever at 12pt]

whatever

\stoptext



Thank you.  One thing that \getscaledglyph does it works agnostic to the 
currently selected font.  For example:


scaling glyphs in one direction is kind of bad anyway so if you want 
just one glyph you can do


\inframed{\scale[width=3em,height=1ex]{...}}

or whatever suits the purpose


\starttext

% This will print a sans “A” 1.5x larger than 12pt
\switchtobodyfont[12pt,sans]
\getscaledglyph{1.5}{}{A}\par

% This will print a serif “A” 1.5x larger than 10pt
\switchtobodyfont[10pt,serif]
\getscaledglyph{1.5}{}{A}\par

\stoptext

I’m guessing there isn’t a way to use \definedfont  in a similar fashion?


\definedfont[Serif*whatever sa 1.5]



Also, I noticed that \definedfont doesn’t seem to play nicely with 
\switchtobodyfont:

\starttext

\definefontfeature[whatever][default][extend=2.5]

% This looks ok
\switchtobodyfont[12pt,serif]
{\definedfont[Serif*whatever at 12pt] what}ever\par

% the “ever” is not printed properly, it overlaps itself
\switchtobodyfont[10pt,serif]
{\definedfont[Serif*whatever at 10pt] what}ever\par

\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \getscaledglyph for width-only

2016-08-17 Thread Brian R. Landy

> On Aug 17, 2016, at 5:45 PM, Hans Hagen  wrote:
> 
> On 8/17/2016 9:56 PM, Brian R. Landy wrote:
>> Hi, I was wondering if there is a way to call \getscaledglyph to scale a
>> glyph only horizontally, leaving the height untouched?  Or maybe an
>> alternate command?
>> 
>> I can sort of accomplish this with (for example)
>> \scale[sx=0.75,sy=1.0]{}{A}, but that encloses the glyph in an \hbox,
>> which can be problematic.  \getscaledglyph doesn't cause me any
>> problems, except that it scales the height too.
> 
> \starttext
> 
> \definefontfeature[whatever][default][extend=2.5]
> 
> \definedfont[Serif*whatever at 12pt]
> 
> whatever
> 
> \stoptext
> 

Thank you.  One thing that \getscaledglyph does it works agnostic to the 
currently selected font.  For example:

\starttext

% This will print a sans “A” 1.5x larger than 12pt
\switchtobodyfont[12pt,sans]
\getscaledglyph{1.5}{}{A}\par

% This will print a serif “A” 1.5x larger than 10pt
\switchtobodyfont[10pt,serif]
\getscaledglyph{1.5}{}{A}\par

\stoptext

I’m guessing there isn’t a way to use \definedfont  in a similar fashion?


Also, I noticed that \definedfont doesn’t seem to play nicely with 
\switchtobodyfont:

\starttext

\definefontfeature[whatever][default][extend=2.5]

% This looks ok
\switchtobodyfont[12pt,serif]
{\definedfont[Serif*whatever at 12pt] what}ever\par

% the “ever” is not printed properly, it overlaps itself
\switchtobodyfont[10pt,serif]
{\definedfont[Serif*whatever at 10pt] what}ever\par

\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \getscaledglyph for width-only

2016-08-17 Thread Hans Hagen

On 8/17/2016 9:56 PM, Brian R. Landy wrote:

Hi, I was wondering if there is a way to call \getscaledglyph to scale a
glyph only horizontally, leaving the height untouched?  Or maybe an
alternate command?

I can sort of accomplish this with (for example)
\scale[sx=0.75,sy=1.0]{}{A}, but that encloses the glyph in an \hbox,
which can be problematic.  \getscaledglyph doesn't cause me any
problems, except that it scales the height too.


\starttext

\definefontfeature[whatever][default][extend=2.5]

\definedfont[Serif*whatever at 12pt]

whatever

\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] \getscaledglyph

2011-01-21 Thread Hans Hagen

On 20-1-2011 11:25, Thomas Floeren wrote:

Thank you, Willi, I wasn't aware of this nice font module!
(btw, running it on ArialUnicode with 2 columns and 10pt produces 500 PDF pages 
and a peak memory usage of 1.2 GB!).

I like the idea of using glyph names rather than unicode numbers. For my actual 
purpose your suggestion works perfectly, with \fontchar{emptyset}.

Beside this there are many glyphs with only math names (the rightmost column in 
the fnt-10 output). I couldn't make \fontchar work with these. For example the fore-mentioned 
char 2300 works with \fontchar{uni2300} but not with \fontchar{varnothing}.

Is there a way to set these chars by their math name?


\varnothing



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \getscaledglyph

2011-01-21 Thread Thomas Floeren
 -Original Message-
 From: ntg-context-boun...@ntg.nl [mailto:ntg-context-boun...@ntg.nl] On
 Behalf Of Hans Hagen
 Sent: Friday, January 21, 2011 9:50 AM
 To: mailing list for ConTeXt users
 Subject: Re: [NTG-context] \getscaledglyph
 
 On 20-1-2011 11:25, Thomas Floeren wrote:
  Thank you, Willi, I wasn't aware of this nice font module!
  (btw, running it on ArialUnicode with 2 columns and 10pt produces 500
 PDF pages and a peak memory usage of 1.2 GB!).
 
  I like the idea of using glyph names rather than unicode numbers. For
 my actual purpose your suggestion works perfectly, with
 \fontchar{emptyset}.
 
  Beside this there are many glyphs with only math names (the rightmost
 column in the fnt-10 output). I couldn't make \fontchar work with these.
 For example the fore-mentioned char 2300 works with \fontchar{uni2300}
 but not with \fontchar{varnothing}.
 
  Is there a way to set these chars by their math name?
 
 \varnothing
 
 

so simple ;)
Thank you


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \getscaledglyph

2011-01-20 Thread Willi Egger
Hi Thomas,

I had to do some work with regard to this issue recently.

What was mentioned on this list, is, that \fontchar is a command which will 
stay.

\setupbodyfont[Myfont,rm,12pt]
\definesymbol[Q.alt]  [\fontchar{Q.alt}]
\def\Qa{\symbol[Q.alt]}

The easiest way to get a stable environment is to use the char-names from the 
font. You can extract a table with all char-names with 

\usemodule[fnt-10]
\setupbodyfont[Myfont,rm,12pt]
\starttext
\ShowCompleteFont{Myfont.otf}{10pt}{1} % fontname, size,columns
% \ShowAllGlyphs   {Myfont}{48pt}{4} % fontname, size,columns  
\stoptext

Kind regards

Willi
On 20 Jan 2011, at 08:51, Thomas Floeren wrote:

 Hi,
 
 I did a rather huge update step from my working context 2010.09.29 to the 
 actual beta. I noted that \getscaledglyph doesn’t work anymore. 
 
 I use it a lot for symbol insertions like this:
 
 \definefontsynonym [ArialU] [name:ArialUnicodeMS]
 \definesymbol [Diameter] [\getscaledglyph{1.5}{ArialU}{\char2300}]
 \def\Diam{\symbol[Diameter]}
 
 \starttext
 hello \Diam\ goodbye
 \stoptext
 
 
 ( \getglyph seems to work as usual: \definesymbol [Diameter] 
 [\tfb\getglyph{ArialU}{\char2300}] )
 
 Should I better change my definitions or is it just a bug?
 
 
 
 Thank you
  Greetings
 Thomas
 
 
 MTXrun | current version: 2011.01.18 19:34
 This is LuaTeX, Version beta-0.65.0-2010121316
 
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] \getscaledglyph

2011-01-20 Thread Thomas Floeren
Thank you, Willi, I wasn't aware of this nice font module!
(btw, running it on ArialUnicode with 2 columns and 10pt produces 500 PDF pages 
and a peak memory usage of 1.2 GB!).

I like the idea of using glyph names rather than unicode numbers. For my actual 
purpose your suggestion works perfectly, with \fontchar{emptyset}. 

Beside this there are many glyphs with only math names (the rightmost column 
in the fnt-10 output). I couldn't make \fontchar work with these. For example 
the fore-mentioned char 2300 works with \fontchar{uni2300} but not with 
\fontchar{varnothing}.

Is there a way to set these chars by their math name?

Thomas


On Jan 20, 2011, at 16:37, Willi Egger wrote:

 Hi Thomas,
 
 I had to do some work with regard to this issue recently.
 
 What was mentioned on this list, is, that \fontchar is a command which will 
 stay.
 
 \setupbodyfont[Myfont,rm,12pt]
 \definesymbol[Q.alt]  [\fontchar{Q.alt}]
 \def\Qa{\symbol[Q.alt]}
 
 The easiest way to get a stable environment is to use the char-names from the 
 font. You can extract a table with all char-names with 
 
 \usemodule[fnt-10]
 \setupbodyfont[Myfont,rm,12pt]
 \starttext
   \ShowCompleteFont{Myfont.otf}{10pt}{1} % fontname, size,columns
   % \ShowAllGlyphs   {Myfont}{48pt}{4} % fontname, size,columns  
 \stoptext
 
 Kind regards
 
 Willi
 On 20 Jan 2011, at 08:51, Thomas Floeren wrote:
 
 Hi,
 
 I did a rather huge update step from my working context 2010.09.29 to the 
 actual beta. I noted that \getscaledglyph doesn’t work anymore. 
 
 I use it a lot for symbol insertions like this:
 
 \definefontsynonym [ArialU] [name:ArialUnicodeMS]
 \definesymbol [Diameter] [\getscaledglyph{1.5}{ArialU}{\char2300}]
 \def\Diam{\symbol[Diameter]}
 
 \starttext
 hello \Diam\ goodbye
 \stoptext
 
 
 ( \getglyph seems to work as usual: \definesymbol [Diameter] 
 [\tfb\getglyph{ArialU}{\char2300}] )
 
 Should I better change my definitions or is it just a bug?
 
 
 
 Thank you
  Greetings
 Thomas
 
 
 MTXrun | current version: 2011.01.18 19:34
 This is LuaTeX, Version beta-0.65.0-2010121316
 
 ___
 If your question is of interest to others as well, please add an entry to 
 the Wiki!
 
 maillist : ntg-context@ntg.nl / 
 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___
 
 ___
 If your question is of interest to others as well, please add an entry to the 
 Wiki!
 
 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___