ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Mathdesign GD with simplefonts
@ 2013-10-07  7:06 Magnus J
  2013-10-07  9:57 ` Alan BRASLAU
  2013-10-08 15:30 ` Wolfgang Schuster
  0 siblings, 2 replies; 9+ messages in thread
From: Magnus J @ 2013-10-07  7:06 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 864 bytes --]

Hello list,

Long term (silent) on-and-off user with two issues that require some
support:

1. How can I use the Mathdesign GD math font in ConTeXt? I use simplefonts
to load Adobe Garamond Pro, but mathdesigngd (name as reported by mtxrun
fonts script) is somehow not found. At this time I fallback to ugly
solutions with \text in math mode. And yes, I know about
type-imp-mathdesign.mkiv, but obviously I'm not qualified enough to get it
right.

Minimal (not) working example:

  \usemodule[simplefonts]

  \setmainfont[Adobe Garamond Pro]
  \setmathfont[mathdesigngd]

  \starttext
    I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too.
  \stoptext

2. I would like to use the \followtokens macro from within metapost. How
can this be achieved? Specifically, I trying to draw a rainbow-like figure
with text "between" the colors.

Regards,

Magnus

[-- Attachment #1.2: Type: text/html, Size: 1072 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Mathdesign GD with simplefonts
  2013-10-07  7:06 Mathdesign GD with simplefonts Magnus J
@ 2013-10-07  9:57 ` Alan BRASLAU
  2013-10-07 15:20   ` Magnus J
  2013-10-08 15:30 ` Wolfgang Schuster
  1 sibling, 1 reply; 9+ messages in thread
From: Alan BRASLAU @ 2013-10-07  9:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: mjo.lists

On Mon, 7 Oct 2013 09:06:37 +0200
Magnus J <mjo.lists@gmail.com> wrote:

> 2. I would like to use the \followtokens macro from within metapost. How
> can this be achieved? Specifically, I trying to draw a rainbow-like figure
> with text "between" the colors.

I am not sure what you mean by a rainbow-like figure. However, for rainbow-like colors, I use the following MP code, based on the standard resistance color code scheme. The function rainbow(f) returns a rainbow spectrum color based on the fraction f running from 0 to 1.

% standard resistance color code: rainbow sequence
color resistance_color[] ;                      string resistance_name[] ;
resistance_color0 = (0,0,0) ;                   resistance_name0 = "black" ;
resistance_color1 = (165/255,42/255,42/255) ;   resistance_name1 = "brown" ;
resistance_color2 = (1,0,0) ;                   resistance_name2 = "red" ;
resistance_color3 = (1,165/255,0) ;             resistance_name3 = "orange" ;
resistance_color4 = (1,1,0) ;                   resistance_name4 = "yellow" ;
resistance_color5 = (0,1,0) ;                   resistance_name5 = "green" ;
resistance_color6 = (0,0,1) ;                   resistance_name6 = "blue" ;
resistance_color7 = (148/255,0,211/255) ;       resistance_name7 = "darkviolet" ;
resistance_color8 = (190/255,190/255,190/255) ; resistance_name8 = "gray" ;
resistance_color9 = (1,1,1) ;                   resistance_name9 = "white" ;

def rainbow(expr f) =
    hide(numeric n_ ; n_ = (abs(5f) mod 5) + 2 ;)
    (n_-floor(n_))[resistance_color[floor n_],resistance_color[ceiling n_]]
enddef ;


Alan
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Mathdesign GD with simplefonts
  2013-10-07  9:57 ` Alan BRASLAU
@ 2013-10-07 15:20   ` Magnus J
  0 siblings, 0 replies; 9+ messages in thread
From: Magnus J @ 2013-10-07 15:20 UTC (permalink / raw)
  To: Alan BRASLAU; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1834 bytes --]

Thanks, nice scale. How about the arcs and the text between them?

Regards,

Magnus


On Mon, Oct 7, 2013 at 11:57 AM, Alan BRASLAU <alan.braslau@cea.fr> wrote:

> On Mon, 7 Oct 2013 09:06:37 +0200
> Magnus J <mjo.lists@gmail.com> wrote:
>
> > 2. I would like to use the \followtokens macro from within metapost. How
> > can this be achieved? Specifically, I trying to draw a rainbow-like
> figure
> > with text "between" the colors.
>
> I am not sure what you mean by a rainbow-like figure. However, for
> rainbow-like colors, I use the following MP code, based on the standard
> resistance color code scheme. The function rainbow(f) returns a rainbow
> spectrum color based on the fraction f running from 0 to 1.
>
> % standard resistance color code: rainbow sequence
> color resistance_color[] ;                      string resistance_name[] ;
> resistance_color0 = (0,0,0) ;                   resistance_name0 = "black"
> ;
> resistance_color1 = (165/255,42/255,42/255) ;   resistance_name1 = "brown"
> ;
> resistance_color2 = (1,0,0) ;                   resistance_name2 = "red" ;
> resistance_color3 = (1,165/255,0) ;             resistance_name3 =
> "orange" ;
> resistance_color4 = (1,1,0) ;                   resistance_name4 =
> "yellow" ;
> resistance_color5 = (0,1,0) ;                   resistance_name5 = "green"
> ;
> resistance_color6 = (0,0,1) ;                   resistance_name6 = "blue" ;
> resistance_color7 = (148/255,0,211/255) ;       resistance_name7 =
> "darkviolet" ;
> resistance_color8 = (190/255,190/255,190/255) ; resistance_name8 = "gray" ;
> resistance_color9 = (1,1,1) ;                   resistance_name9 = "white"
> ;
>
> def rainbow(expr f) =
>     hide(numeric n_ ; n_ = (abs(5f) mod 5) + 2 ;)
>     (n_-floor(n_))[resistance_color[floor n_],resistance_color[ceiling n_]]
> enddef ;
>
>
> Alan
>

[-- Attachment #1.2: Type: text/html, Size: 2430 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Mathdesign GD with simplefonts
  2013-10-07  7:06 Mathdesign GD with simplefonts Magnus J
  2013-10-07  9:57 ` Alan BRASLAU
@ 2013-10-08 15:30 ` Wolfgang Schuster
  2013-10-08 15:42   ` Magnus J
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2013-10-08 15:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Magnus J


Am 07.10.2013 um 09:06 schrieb Magnus J <mjo.lists@gmail.com>:

> Hello list,
> 
> Long term (silent) on-and-off user with two issues that require some support:
> 
> 1. How can I use the Mathdesign GD math font in ConTeXt? I use simplefonts to load Adobe Garamond Pro, but mathdesigngd (name as reported by mtxrun fonts script) is somehow not found. At this time I fallback to ugly solutions with \text in math mode. And yes, I know about type-imp-mathdesign.mkiv, but obviously I'm not qualified enough to get it right.
> 
> Minimal (not) working example:
> 
>   \usemodule[simplefonts]
> 
>   \setmainfont[Adobe Garamond Pro]
>   \setmathfont[mathdesigngd]
> 
>   \starttext
>     I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too.
>   \stoptext

The Mathdesign fonts aren’t part of the normal installation and you have to add “--fonts=mathdesign” or “--fonts=all” when you call first-setup.sh|bat.

Wolfgang

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Mathdesign GD with simplefonts
  2013-10-08 15:30 ` Wolfgang Schuster
@ 2013-10-08 15:42   ` Magnus J
  2013-10-08 16:08     ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Magnus J @ 2013-10-08 15:42 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1274 bytes --]

I have the fonts and they are reported as mathdesigngd by the mtxrun fonts
script -- sorry if this was unclear. How do I proceed from here?

Regards,

Magnus


On Tue, Oct 8, 2013 at 5:30 PM, Wolfgang Schuster <
schuster.wolfgang@gmail.com> wrote:

>
> Am 07.10.2013 um 09:06 schrieb Magnus J <mjo.lists@gmail.com>:
>
> > Hello list,
> >
> > Long term (silent) on-and-off user with two issues that require some
> support:
> >
> > 1. How can I use the Mathdesign GD math font in ConTeXt? I use
> simplefonts to load Adobe Garamond Pro, but mathdesigngd (name as reported
> by mtxrun fonts script) is somehow not found. At this time I fallback to
> ugly solutions with \text in math mode. And yes, I know about
> type-imp-mathdesign.mkiv, but obviously I'm not qualified enough to get it
> right.
> >
> > Minimal (not) working example:
> >
> >   \usemodule[simplefonts]
> >
> >   \setmainfont[Adobe Garamond Pro]
> >   \setmathfont[mathdesigngd]
> >
> >   \starttext
> >     I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too.
> >   \stoptext
>
> The Mathdesign fonts aren’t part of the normal installation and you have
> to add “--fonts=mathdesign” or “--fonts=all” when you call
> first-setup.sh|bat.
>
> Wolfgang
>
>

[-- Attachment #1.2: Type: text/html, Size: 1815 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Mathdesign GD with simplefonts
  2013-10-08 15:42   ` Magnus J
@ 2013-10-08 16:08     ` Wolfgang Schuster
  2013-10-08 16:26       ` Magnus J
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2013-10-08 16:08 UTC (permalink / raw)
  To: Magnus J; +Cc: mailing list for ConTeXt users


Am 08.10.2013 um 17:42 schrieb Magnus J <mjo.lists@gmail.com>:

> I have the fonts and they are reported as mathdesigngd by the mtxrun fonts script -- sorry if this was unclear. How do I proceed from here?


This should work (can’t test it myself):

\usetypescriptfile[mathdesign]

\usemodule[simplefonts]

\setmainfont[Adobe Garamond Pro]
\setmathfont[mathdesigngm]

\starttext
I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too.
\stoptext

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Mathdesign GD with simplefonts
  2013-10-08 16:08     ` Wolfgang Schuster
@ 2013-10-08 16:26       ` Magnus J
  2013-10-08 17:38         ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Magnus J @ 2013-10-08 16:26 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1969 bytes --]

With mathdesigngd (which is intended to complement Adobe Garamond Pro, and
the one that I want), I get
  fonts           > typescripts > unknown library 'mathdesigngd'
in the output. With mathdesigngm, I get (cropped output)

system          > tex > error on line 8 in file /tmp/test.tex: LuaTeX
error  ...

 1
 2     \usetypescriptfile[mathdesign]
 3
 4     \usemodule[simplefonts]
 5
 6     \setmainfont[Adobe Garamond Pro]
 7     \setmathfont[mathdesigngm]
 8 >>
 9     \starttext
10     I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too.
11     \stoptext


\ctxcommand #1^^@-\directlua {commands.#1}

\font_helpers_low_level_define ...caledfontmode )}
                                                  \edef \somefontspec {at
\n...
\font_helpers_trigger_define ..._identifier_class
                                                  \csname
\v_font_identifier...
\font_helpers_set_math_family_a ...ily \endcsname
                                                  \else
\font_helpers_set_ma...
\font_helpers_set_math_family_indeed ..._family_a
                                                  \scriptscriptfont #1\font
...
\font_helpers_set_math_family ...amily_indeed #1#2
                                                  \fi \else
\font_helpers_se...
...
l.8


What now?

Regards,

Magnus


On Tue, Oct 8, 2013 at 6:08 PM, Wolfgang Schuster <
schuster.wolfgang@gmail.com> wrote:

>
> Am 08.10.2013 um 17:42 schrieb Magnus J <mjo.lists@gmail.com>:
>
> > I have the fonts and they are reported as mathdesigngd by the mtxrun
> fonts script -- sorry if this was unclear. How do I proceed from here?
>
>
> This should work (can’t test it myself):
>
> \usetypescriptfile[mathdesign]
>
> \usemodule[simplefonts]
>
> \setmainfont[Adobe Garamond Pro]
> \setmathfont[mathdesigngm]
>
> \starttext
> I want \m{x^2+y^2=z^2} in my text, and $\alpha\beta\gamma$ too.
> \stoptext
>
> Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2728 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Mathdesign GD with simplefonts
  2013-10-08 16:26       ` Magnus J
@ 2013-10-08 17:38         ` Wolfgang Schuster
  2013-10-08 18:40           ` Magnus J
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2013-10-08 17:38 UTC (permalink / raw)
  To: Magnus J; +Cc: mailing list for ConTeXt users


Am 08.10.2013 um 18:26 schrieb Magnus J <mjo.lists@gmail.com>:

> With mathdesigngd (which is intended to complement Adobe Garamond Pro, and the one that I want), I get
>   fonts           > typescripts > unknown library 'mathdesigngd'
> in the output. With mathdesigngm, I get (cropped output)

1. It’s possible the math design fonts uses different file name than the ones context expects and this is the cause for the error message.

2. Math for Adobe Garamond isn’t supported yet by context.

I can take a look why math design fails and fix but not today because it takes a while to check all files.

Wolfgang 
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Mathdesign GD with simplefonts
  2013-10-08 17:38         ` Wolfgang Schuster
@ 2013-10-08 18:40           ` Magnus J
  0 siblings, 0 replies; 9+ messages in thread
From: Magnus J @ 2013-10-08 18:40 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 817 bytes --]

Wonderful, this is really appreciated.

Regards,

Magnus


On Tue, Oct 8, 2013 at 7:38 PM, Wolfgang Schuster <
schuster.wolfgang@gmail.com> wrote:

>
> Am 08.10.2013 um 18:26 schrieb Magnus J <mjo.lists@gmail.com>:
>
> > With mathdesigngd (which is intended to complement Adobe Garamond Pro,
> and the one that I want), I get
> >   fonts           > typescripts > unknown library 'mathdesigngd'
> > in the output. With mathdesigngm, I get (cropped output)
>
> 1. It’s possible the math design fonts uses different file name than the
> ones context expects and this is the cause for the error message.
>
> 2. Math for Adobe Garamond isn’t supported yet by context.
>
> I can take a look why math design fails and fix but not today because it
> takes a while to check all files.
>
> Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1309 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-10-08 18:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-07  7:06 Mathdesign GD with simplefonts Magnus J
2013-10-07  9:57 ` Alan BRASLAU
2013-10-07 15:20   ` Magnus J
2013-10-08 15:30 ` Wolfgang Schuster
2013-10-08 15:42   ` Magnus J
2013-10-08 16:08     ` Wolfgang Schuster
2013-10-08 16:26       ` Magnus J
2013-10-08 17:38         ` Wolfgang Schuster
2013-10-08 18:40           ` Magnus J

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).