ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to define fallback font for symbols
@ 2011-06-17  7:43 Vianney le Clément
  2011-06-17  7:52 ` Hans Hagen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Vianney le Clément @ 2011-06-17  7:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi all,

Is it possible to set a fallback font from which glyphs will be taken
if the current font doesn't have it? For example, I'd want to use
fancy miscellaneous symbols from the Symbola font using their unicode
codepoint without any extra font-changing command (and obviously, I
don't want to use Symbola for the rest of the text).

Alternatively, setting different fonts for different unicode blocks
would also do the trick.

Vianney
___________________________________________________________________________________
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] 5+ messages in thread

* Re: How to define fallback font for symbols
  2011-06-17  7:43 How to define fallback font for symbols Vianney le Clément
@ 2011-06-17  7:52 ` Hans Hagen
  2011-06-17  8:42   ` Vianney le Clément
  2011-06-17  7:59 ` luigi scarso
  2011-06-17 11:19 ` Wolfgang Schuster
  2 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2011-06-17  7:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 17-6-2011 9:43, Vianney le Clément wrote:
> Hi all,
>
> Is it possible to set a fallback font from which glyphs will be taken
> if the current font doesn't have it? For example, I'd want to use
> fancy miscellaneous symbols from the Symbola font using their unicode
> codepoint without any extra font-changing command (and obviously, I
> don't want to use Symbola for the rest of the text).
>
> Alternatively, setting different fonts for different unicode blocks
> would also do the trick.

comment from source:

% \definefontfallback [whatever] [Slanted]     [0x0060-0x007F] [force=yes]
% \definefontfallback [whatever] [Bold] 
[0x0080:0x00FF,0x00A0:0x00AF] [rscale=2.0]
% \definefontfallback [whatever] [BoldSlanted] ["00C0-"00C7] 
[check=yes,force=yes]
% \definefontfallback [whatever] [Mono]        [latinextendeda] 
[force=yes] % 0x0100:0x017F
% \definefontfallback [whatever] [Mono]        [latin extended a] 
[force=yes] % 0x0100:0x017F
%
% \definefontsynonym[SerifPlus][Serif][fallbacks=whatever]
%
% \showfont[SerifPlus][all]

% \definefontfeature[zh][mode=node,script=hang,lang=zhs]
% \definefontfallback[serifwhatever]          [lmroman10-regular] 
[0x0000-0x0400][force=yes]
% \definefontfallback[serifboldwhatever]      [lmroman10-bold] 
[0x0000-0x0400][force=yes]
% \definefontfallback[serifitalicwhatever]    [lmroman10-italic] 
[0x0000-0x0400][force=yes]
% 
\definefontfallback[serifbolditalicwhatever][lmroman10-bolditalic][0x0000-0x0400][force=yes]
%
% \starttypescript [serif] [zhfont]
%    \definefontsynonym [zhserif]          [AdobeSongStd-Light] 
[features=zh,fallbacks=serifwhatever]
%    \definefontsynonym [zhserifbold] 
[AdobeHeitiStd-Regular][features=zh,fallbacks=serifboldwhatever]
%    \definefontsynonym [zhserifitalic] 
[AdobeKaitiStd-Regular][features=zh,fallbacks=serifitalicwhatever]
%    \definefontsynonym 
[zhserifbolditalic][AdobeHeitiStd-Regular][features=zh,fallbacks=serifbolditalicwhatever]
% \stoptypescript
%
% \starttypescript [serif][zhfont][name]
%    \definefontsynonym[Serif]             [zhserif]             % 
[fallbacks=serifwhatever]
%    \definefontsynonym[SerifBold]         [zhserifbold]         % 
[fallbacks=serifboldwhatever]
%    \definefontsynonym[SerifItalic]       [zhserifitalic]       % 
[fallbacks=serifitalicwhatever]
%    \definefontsynonym[SerifBoldItalic]   [zhserifbolditalic]   % 
[fallbacks=serifbolditalicwhatever]
% \stoptypescript
%
% \starttypescript[myfont]
%    \definetypeface[myfont][rm][serif][zhfont]
% \stoptypescript
%
% \usetypescript[myfont] \setupbodyfont[myfont,rm,12pt]
%
% \starttext
%   fonts {\bf fonts} {\bi fonts} {\it fonts}
% \stoptext


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


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

* Re: How to define fallback font for symbols
  2011-06-17  7:43 How to define fallback font for symbols Vianney le Clément
  2011-06-17  7:52 ` Hans Hagen
@ 2011-06-17  7:59 ` luigi scarso
  2011-06-17 11:19 ` Wolfgang Schuster
  2 siblings, 0 replies; 5+ messages in thread
From: luigi scarso @ 2011-06-17  7:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2011/6/17 Vianney le Clément <vleclement@gmail.com>:
> Hi all,
>
> Is it possible to set a fallback font from which glyphs will be taken
> if the current font doesn't have it? For example, I'd want to use
> fancy miscellaneous symbols from the Symbola font using their unicode
> codepoint without any extra font-changing command (and obviously, I
> don't want to use Symbola for the rest of the text).
>
> Alternatively, setting different fonts for different unicode blocks
> would also do the trick.
Chapter 10 of "fonts in context" book.


-- 
luigi
___________________________________________________________________________________
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] 5+ messages in thread

* Re: How to define fallback font for symbols
  2011-06-17  7:52 ` Hans Hagen
@ 2011-06-17  8:42   ` Vianney le Clément
  0 siblings, 0 replies; 5+ messages in thread
From: Vianney le Clément @ 2011-06-17  8:42 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

2011/6/17 Hans Hagen <pragma@wxs.nl>:
> % \definefontfeature[zh][mode=node,script=hang,lang=zhs]
> % \definefontfallback[serifwhatever]          [lmroman10-regular]
> [0x0000-0x0400][force=yes]
> % \definefontfallback[serifboldwhatever]      [lmroman10-bold]
> [0x0000-0x0400][force=yes]
> % \definefontfallback[serifitalicwhatever]    [lmroman10-italic]
> [0x0000-0x0400][force=yes]
> %
> \definefontfallback[serifbolditalicwhatever][lmroman10-bolditalic][0x0000-0x0400][force=yes]
> %
> % \starttypescript [serif] [zhfont]
> %    \definefontsynonym [zhserif]          [AdobeSongStd-Light]
> [features=zh,fallbacks=serifwhatever]
> %    \definefontsynonym [zhserifbold]
> [AdobeHeitiStd-Regular][features=zh,fallbacks=serifboldwhatever]
> %    \definefontsynonym [zhserifitalic]
> [AdobeKaitiStd-Regular][features=zh,fallbacks=serifitalicwhatever]
> %    \definefontsynonym
> [zhserifbolditalic][AdobeHeitiStd-Regular][features=zh,fallbacks=serifbolditalicwhatever]
> % \stoptypescript
> %
> % \starttypescript [serif][zhfont][name]
> %    \definefontsynonym[Serif]             [zhserif]             %
> [fallbacks=serifwhatever]
> %    \definefontsynonym[SerifBold]         [zhserifbold]         %
> [fallbacks=serifboldwhatever]
> %    \definefontsynonym[SerifItalic]       [zhserifitalic]       %
> [fallbacks=serifitalicwhatever]
> %    \definefontsynonym[SerifBoldItalic]   [zhserifbolditalic]   %
> [fallbacks=serifbolditalicwhatever]
> % \stoptypescript
> %
> % \starttypescript[myfont]
> %    \definetypeface[myfont][rm][serif][zhfont]
> % \stoptypescript
> %
> % \usetypescript[myfont] \setupbodyfont[myfont,rm,12pt]
> %
> % \starttext
> %   fonts {\bf fonts} {\bi fonts} {\it fonts}
> % \stoptext

This works fine, thanks.

However, instead of redefining the typescripts, is it possible to set
a global fallback for all fonts, like we can do for font features?
E.g.
   \definefontfeature[default][default][fallbacks=whatever]
to be able to reuse existing typescripts.

Vianney
___________________________________________________________________________________
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] 5+ messages in thread

* Re: How to define fallback font for symbols
  2011-06-17  7:43 How to define fallback font for symbols Vianney le Clément
  2011-06-17  7:52 ` Hans Hagen
  2011-06-17  7:59 ` luigi scarso
@ 2011-06-17 11:19 ` Wolfgang Schuster
  2 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2011-06-17 11:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 17.06.2011 um 09:43 schrieb Vianney le Clément:

> Hi all,
> 
> Is it possible to set a fallback font from which glyphs will be taken
> if the current font doesn't have it? For example, I'd want to use
> fancy miscellaneous symbols from the Symbola font using their unicode
> codepoint without any extra font-changing command (and obviously, I
> don't want to use Symbola for the rest of the text).
> 
> Alternatively, setting different fonts for different unicode blocks
> would also do the trick.

\usemodule[simplefonts]

\setmainfontfallback[Symbola][range=0x0001-0xFFFF,force=no]
\setmainfont[TeX Gyre Pagella]

\starttext
Palatino ❡
\stoptext

You can control the replacement of the main font with the “check”
and “force” keys (requires the latest version of the module i uploaded
a few minutes ago), Hans described their function in context’s source:

% check : only replace when present in replacement font (default: no)
% force : force replacent even when basefont has glyph  (default: yes)

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] 5+ messages in thread

end of thread, other threads:[~2011-06-17 11:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-17  7:43 How to define fallback font for symbols Vianney le Clément
2011-06-17  7:52 ` Hans Hagen
2011-06-17  8:42   ` Vianney le Clément
2011-06-17  7:59 ` luigi scarso
2011-06-17 11:19 ` Wolfgang Schuster

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).