Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread Hans Hagen

On 10/4/2018 4:10 PM, mf wrote:


In Debian, evince has the same problem (ugly preview); instead 
qpdfview preview is OK.

maybe some aliasing option?


evince (ugly) uses cairo, qpdfview (good) uses qt.

Zooming out the preview becomes uglier, but
- evince emboldens too much
- qpdfview shifts the emboldened glyphs downward

that why i suggested a vshift

\definefontfeature[emboldened][effect={width=0.18,delta=0.4,factor=0.3,vshift=.4}]



-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread Taco Hoekwater
Hi,

> On 4 Oct 2018, at 15:46, Hans Hagen  wrote:
> 
> On 10/4/2018 3:19 PM, Taco Hoekwater wrote:
>>> On 4 Oct 2018, at 14:11, Hans Hagen  wrote:
>>> 
>>> On 10/4/2018 1:44 PM, Taco Hoekwater wrote:
 Hi,
> ok, even nicer:
> 
>\definefontfallback[FakeSansCaps]   [SansEmboldened] 
> [0x-0x] [rscale=.8,method=uppercase]
> 
> which will remap all lowercase in the font so that you also get accented 
> characters
 I do not like ‘emboldened’ as it results in a very ugly screen preview for 
 me.
 But the new ‘uppercase’ feature is really neat, since it makes something 
 that
 I had in mind for IBM Plex very easy to implement. Here is the demo:
>>> 
>>> hm, here it actually looks quote ok ... apple preview issue?
>> Probably, but that also means I will not trust an unknown device at some
>> printshop to do the ‘right thing’.
> hm, so then you can't trust linewidths either because that is what it does

Modifying the text rendering mode (Tr operator) is not quite the same
as altering the line width in the page stream. Typically, renderers
have separate code paths for text rendering and font rendering. 

Anyway, to add to the list: mupdf-gl also appears to do fine.

Best wishes,
Taco




___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread mf


In Debian, evince has the same problem (ugly preview); instead 
qpdfview preview is OK.

maybe some aliasing option?


evince (ugly) uses cairo, qpdfview (good) uses qt.

Zooming out the preview becomes uglier, but
- evince emboldens too much
- qpdfview shifts the emboldened glyphs downward
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread luigi scarso
On Thu, Oct 4, 2018 at 3:35 PM mf  wrote:

> In Debian, evince has the same problem (ugly preview); instead qpdfview
> preview is OK.
>

qpdfview -> Edit->Settings->Graphics General/PDF/PS
Several "antialias like" option, plus backend.

-- 
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread Hans Hagen

On 10/4/2018 3:19 PM, Taco Hoekwater wrote:




On 4 Oct 2018, at 14:11, Hans Hagen  wrote:

On 10/4/2018 1:44 PM, Taco Hoekwater wrote:

Hi,

ok, even nicer:

\definefontfallback[FakeSansCaps]   [SansEmboldened] [0x-0x] 
[rscale=.8,method=uppercase]

which will remap all lowercase in the font so that you also get accented 
characters

I do not like ‘emboldened’ as it results in a very ugly screen preview for me.
But the new ‘uppercase’ feature is really neat, since it makes something that
I had in mind for IBM Plex very easy to implement. Here is the demo:


hm, here it actually looks quote ok ... apple preview issue?


Probably, but that also means I will not trust an unknown device at some
printshop to do the ‘right thing’.

hm, so then you can't trust linewidths either because that is what it does

Hans


-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread Hans Hagen

On 10/4/2018 3:35 PM, mf wrote:

Il 04/10/18 14:11, Hans Hagen ha scritto:

On 10/4/2018 1:44 PM, Taco Hoekwater wrote:

Hi,


ok, even nicer:

    \definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x-0x] [rscale=.8,method=uppercase]


which will remap all lowercase in the font so that you also get 
accented characters


I do not like ‘emboldened’ as it results in a very ugly screen 
preview for me.


But the new ‘uppercase’ feature is really neat, since it makes 
something that

I had in mind for IBM Plex very easy to implement. Here is the demo:


hm, here it actually looks quote ok ... apple preview issue?

In Debian, evince has the same problem (ugly preview); instead qpdfview 
preview is OK.

maybe some aliasing option?


-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread mf

Il 04/10/18 14:11, Hans Hagen ha scritto:

On 10/4/2018 1:44 PM, Taco Hoekwater wrote:

Hi,


ok, even nicer:

    \definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x-0x] [rscale=.8,method=uppercase]


which will remap all lowercase in the font so that you also get 
accented characters


I do not like ‘emboldened’ as it results in a very ugly screen preview 
for me.


But the new ‘uppercase’ feature is really neat, since it makes 
something that

I had in mind for IBM Plex very easy to implement. Here is the demo:


hm, here it actually looks quote ok ... apple preview issue?

In Debian, evince has the same problem (ugly preview); instead qpdfview 
preview is OK.


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread Taco Hoekwater


> On 4 Oct 2018, at 14:11, Hans Hagen  wrote:
> 
> On 10/4/2018 1:44 PM, Taco Hoekwater wrote:
>> Hi,
>>> ok, even nicer:
>>> 
>>>\definefontfallback[FakeSansCaps]   [SansEmboldened] [0x-0x] 
>>> [rscale=.8,method=uppercase]
>>> 
>>> which will remap all lowercase in the font so that you also get accented 
>>> characters
>> I do not like ‘emboldened’ as it results in a very ugly screen preview for 
>> me.
>> But the new ‘uppercase’ feature is really neat, since it makes something that
>> I had in mind for IBM Plex very easy to implement. Here is the demo:
> 
> hm, here it actually looks quote ok ... apple preview issue?

Probably, but that also means I will not trust an unknown device at some
printshop to do the ‘right thing’.

Best wishes,
Taco



___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread Hans Hagen

On 10/4/2018 1:44 PM, Taco Hoekwater wrote:

Hi,


ok, even nicer:

\definefontfallback[FakeSansCaps]   [SansEmboldened] [0x-0x] 
[rscale=.8,method=uppercase]

which will remap all lowercase in the font so that you also get accented 
characters


I do not like ‘emboldened’ as it results in a very ugly screen preview for me.

But the new ‘uppercase’ feature is really neat, since it makes something that
I had in mind for IBM Plex very easy to implement. Here is the demo:


hm, here it actually looks quote ok ... apple preview issue?

-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-04 Thread Taco Hoekwater
Hi,

> ok, even nicer:
> 
>\definefontfallback[FakeSansCaps]   [SansEmboldened] [0x-0x] 
> [rscale=.8,method=uppercase]
> 
> which will remap all lowercase in the font so that you also get accented 
> characters

I do not like ‘emboldened’ as it results in a very ugly screen preview for me.

But the new ‘uppercase’ feature is really neat, since it makes something that
I had in mind for IBM Plex very easy to implement. Here is the demo:


\starttypescriptcollection [plextest]

\starttypescript [sans] [plextest]
   \setups[font:fallback:sans]
   \definefontsynonym [Sans]   [file:IBMPlexSans-regular]   
[features=default]
   \definefontsynonym [SansDarker] [file:IBMPlexSans-text]  
[features=default]
   \definefontfallback[FakeSansCaps]   [SansDarker] [0x-0x] 
[rscale=0.75,method=uppercase]
   \definefontsynonym [SansCaps]   [file:IBMPlexSans-regular]   
[fallbacks=FakeSansCaps]
\stoptypescript

\starttypescript [plextest]
   \definetypeface [plextest] [ss] [sans]  [plextest] [default] 
[features=default]
\stoptypescript

\stoptypescriptcollection

\usetypescript[plextest]
\setupbodyfont[plextest]

\starttext
   \startTEXpage
   Some camelcase and number and 
   {\sc SoMe CaMeLcAsE TeXt with Numbers and also
   EA\"e\'a\ae\AE\ and whatever has lowercase, like
   Effe Flink} but also different stuff
   \stopTEXpage
\stoptext

This only works for font families with many weights (IBM Plex has eight), but 
there are more of those
around these days. 

With a bit of tweaking to the rscale, it should be possible to get visually 
correct greyness values 
for all of the family's fonts except for the most bold one (bold smallcaps is 
generally ugly anyway).


Best wishes,

Taco

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-03 Thread Hans Hagen

Hi,

better shift a bit up to compensate for the line width relative to the 
bbox:



\starttypescriptcollection [myriadpro]

   \definefontfeature[emboldened][effect={width=0.18,delta=0.4,factor=0.3}]



\definefontfeature[emboldened][effect={width=0.18,delta=0.4,factor=0.3,vshift=.4}]



   \starttypescript [sans] [myriadpro]
     \definefontsynonym [Sans] [file:MyriadPro-Regular.otf]  
[features=default]
     \definefontsynonym [SansItalic] [file:MyriadPro-It.otf] 
   [features=default]
     \definefontsynonym [SansBold]   [file:MyriadPro-Bold.otf] 
   [features=default]
     \definefontsynonym [SansBoldItalic] [file:MyriadPro-BoldIt.otf] 
   [features=default]
     \definefontsynonym [SansSlanted]    [file:MyriadPro-It.otf] 
   [features=default]
     \definefontsynonym [SansBoldSlanted]    [file:MyriadPro-BoldIt.otf] 
   [features=default]


     \definefontsynonym [SansEmboldened] [Sans] 
[features={default,emboldened}]
     \definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x-0x] [rscale=.8,method=uppercase]


     \definefontsynonym [SansCaps]   [file:MyriadPro-Regular.otf] 
[fallbacks=FakeSansCaps]

   \stoptypescript
   \starttypescript [myriadpro]
     \definetypeface [myriadpro] [ss] [sans]  [myriadpro] [default]
   \stoptypescript

\stoptypescriptcollection

\usetypescript[myriadpro]

\setupbodyfont[myriadpro,ss]

\starttext
   % scaled up 4 times to appreciate the thickness equalization
   \scale[sx=4,sy=4]{\sc RoLlErCoAsTeR TeXt.}\par
   \blank
   \scale[sx=4,sy=4]{\sc ÀàÉéÎîÖöÜü.}\par
   \blank
   \scale[sx=4,sy=4]{\sc ŁłĄąĞğŘřŻż.}\par
\stoptext


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-03 Thread mf

\starttypescriptcollection [myriadpro]

  \definefontfeature[emboldened][effect={width=0.18,delta=0.4,factor=0.3}]

  \starttypescript [sans] [myriadpro]
\definefontsynonym [Sans] 
[file:MyriadPro-Regular.otf]  [features=default]
\definefontsynonym [SansItalic] [file:MyriadPro-It.otf] 
  [features=default]
\definefontsynonym [SansBold]   [file:MyriadPro-Bold.otf] 
  [features=default]
\definefontsynonym [SansBoldItalic] [file:MyriadPro-BoldIt.otf] 
  [features=default]
\definefontsynonym [SansSlanted][file:MyriadPro-It.otf] 
  [features=default]
\definefontsynonym [SansBoldSlanted][file:MyriadPro-BoldIt.otf] 
  [features=default]


\definefontsynonym [SansEmboldened] [Sans] 
[features={default,emboldened}]
\definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x-0x] [rscale=.8,method=uppercase]


\definefontsynonym [SansCaps]   [file:MyriadPro-Regular.otf] 
[fallbacks=FakeSansCaps]

  \stoptypescript
  \starttypescript [myriadpro]
\definetypeface [myriadpro] [ss] [sans]  [myriadpro] [default]
  \stoptypescript

\stoptypescriptcollection

\usetypescript[myriadpro]

\setupbodyfont[myriadpro,ss]

\starttext
  % scaled up 4 times to appreciate the thickness equalization
  \scale[sx=4,sy=4]{\sc RoLlErCoAsTeR TeXt.}\par
  \blank
  \scale[sx=4,sy=4]{\sc ÀàÉéÎîÖöÜü.}\par
  \blank
  \scale[sx=4,sy=4]{\sc ŁłĄąĞğŘřŻż.}\par
\stoptext


fake-smallcaps.pdf
Description: Adobe PDF document
\starttypescriptcollection [myriadpro]

  \definefontfeature[emboldened][effect={width=0.18,delta=0.4,factor=0.3}]

  \starttypescript [sans] [myriadpro]
\definefontsynonym [Sans]   [file:MyriadPro-Regular.otf]  [features=default]
\definefontsynonym [SansItalic] [file:MyriadPro-It.otf]   [features=default]
\definefontsynonym [SansBold]   [file:MyriadPro-Bold.otf] [features=default]
\definefontsynonym [SansBoldItalic] [file:MyriadPro-BoldIt.otf]   [features=default]
\definefontsynonym [SansSlanted][file:MyriadPro-It.otf]   [features=default]
\definefontsynonym [SansBoldSlanted][file:MyriadPro-BoldIt.otf]   [features=default]

\definefontsynonym [SansEmboldened] [Sans] [features={default,emboldened}]
\definefontfallback[FakeSansCaps]   [SansEmboldened] [0x-0x] [rscale=.8,method=uppercase]

\definefontsynonym [SansCaps]   [file:MyriadPro-Regular.otf] [fallbacks=FakeSansCaps]
  \stoptypescript
  \starttypescript [myriadpro]
\definetypeface [myriadpro] [ss] [sans]  [myriadpro] [default]
  \stoptypescript

\stoptypescriptcollection

\usetypescript[myriadpro]

\setupbodyfont[myriadpro,ss]

\starttext
  % scaled up 4 times to appreciate the thickness equalization
  \scale[sx=4,sy=4]{\sc RoLlErCoAsTeR TeXt.}\par
  \blank
  \scale[sx=4,sy=4]{\sc ÀàÉéÎîÖöÜü.}\par
  \blank
  \scale[sx=4,sy=4]{\sc ŁłĄąĞğŘřŻż.}\par
\stoptext
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-03 Thread Hans Hagen

On 10/3/2018 4:20 PM, mf wrote:

Il 03/10/18 16:02, Hans Hagen ha scritto:

ok, even nicer:

 \definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x-0x] [rscale=.8,method=uppercase]


which will remap all lowercase in the font so that you also get 
accented characters


Yes, for this case it makes more sense using method=uppercase.

But "target=" is a more general solution (remapping old dingbats fonts 
on the dingbats section of unicode makes sense as an example?)


Would the range 0x-0x overwrite also capital letters?


it checks for the lowercase / uippercase unicode properties so it's safe

In that case i'm afraid we'd have a scaled down, embolded, uppercase 
version of the font, not a small-caps variant with a consistent thickess 
of the glyphs.


no, it more 'clever'


I think i should specify only the lower case letters' ranges.

no, it does that itself

btw, make sure that you also apply default features to the emboldened ...

Hans

-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-03 Thread mf

Il 03/10/18 16:02, Hans Hagen ha scritto:

ok, even nicer:

     \definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x-0x] [rscale=.8,method=uppercase]


which will remap all lowercase in the font so that you also get accented 
characters


Yes, for this case it makes more sense using method=uppercase.

But "target=" is a more general solution (remapping old dingbats fonts 
on the dingbats section of unicode makes sense as an example?)


Would the range 0x-0x overwrite also capital letters?

In that case i'm afraid we'd have a scaled down, embolded, uppercase 
version of the font, not a small-caps variant with a consistent thickess 
of the glyphs.


I think i should specify only the lower case letters' ranges.

Massimiliano
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-03 Thread Hans Hagen

On 10/3/2018 3:29 PM, Hans Hagen wrote:

On 10/3/2018 12:33 PM, mf wrote:

Hello list,
i'm trying to add a smallcaps variant to the MyriadPro font, since it 
does not implement the smcp opentype feature.


My strategy:

- "transplant" the uppercase letters of the MyriadPro-Regular into the 
lowercase letters of the same font with a font fallback that scales 
down the glyphs ("FakeSansCaps" in the following source)


- since the scaled down glyphs get also thinner traits, embolden them 
with a font feature effect ("emboldened" in the following source) to 
make them consistent with the "real" uppercase letters


What is not working: i don't know how to map the uppercase letters to 
the lowercase range; i tried to specify an offset of -32 in


\definefontfallback[FakeSansCaps][SansEmboldened][0x61-0x7a][rscale=.8,force=yes,offset=-32] 



but it does not work.

Here's the minimal (not) working example:

\starttypescriptcollection [myriadpro]

   
\definefontfeature[emboldened][effect={width=0.1,delta=0.4,factor=0.3}]


   \starttypescript [sans] [myriadpro]
 \definefontsynonym [Sans] [file:MyriadPro-Regular.otf] 
[features=default]
 \definefontsynonym [SansItalic] [file:MyriadPro-It.otf] 
   [features=default]
 \definefontsynonym [SansBold]   [file:MyriadPro-Bold.otf] 
   [features=default]
 \definefontsynonym [SansBoldItalic] 
[file:MyriadPro-BoldIt.otf]    [features=default]
 \definefontsynonym [SansSlanted]    [file:MyriadPro-It.otf] 
   [features=default]
 \definefontsynonym [SansBoldSlanted]
[file:MyriadPro-BoldIt.otf]    [features=default]


 \definefontsynonym [SansEmboldened] [Sans] [features=emboldened]
 \definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x61-0x7a] [rscale=.8,force=yes] % offset?


 \definefontsynonym [SansCaps] [file:MyriadPro-Regular.otf] 
[fallbacks=FakeSansCaps]

   \stoptypescript
   \starttypescript [myriadpro]
 \definetypeface [myriadpro] [ss] [sans]  [myriadpro] [default]
   \stoptypescript

\stoptypescriptcollection

\usetypescript[myriadpro]

\setupbodyfont[myriadpro,ss]

\starttext
   % scaled up 4 times to appreciate the thickness compensation
   \scale[sx=4,sy=4]{\sc SoMe CaMeLcAsE TeXt.}\par
\stoptext

'offset' offsets the original, i'll add 'target' so that you can do

     \definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x61-0x7a] [rscale=.8,force=yes,target=0x41]

ok, even nicer:

\definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x-0x] [rscale=.8,method=uppercase]


which will remap all lowercase in the font so that you also get accented 
characters


Hans



-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] faking smallcaps font with font features and fallbacks

2018-10-03 Thread Hans Hagen

On 10/3/2018 12:33 PM, mf wrote:

Hello list,
i'm trying to add a smallcaps variant to the MyriadPro font, since it 
does not implement the smcp opentype feature.


My strategy:

- "transplant" the uppercase letters of the MyriadPro-Regular into the 
lowercase letters of the same font with a font fallback that scales down 
the glyphs ("FakeSansCaps" in the following source)


- since the scaled down glyphs get also thinner traits, embolden them 
with a font feature effect ("emboldened" in the following source) to 
make them consistent with the "real" uppercase letters


What is not working: i don't know how to map the uppercase letters to 
the lowercase range; i tried to specify an offset of -32 in


\definefontfallback[FakeSansCaps][SansEmboldened][0x61-0x7a][rscale=.8,force=yes,offset=-32] 



but it does not work.

Here's the minimal (not) working example:

\starttypescriptcollection [myriadpro]

   \definefontfeature[emboldened][effect={width=0.1,delta=0.4,factor=0.3}]

   \starttypescript [sans] [myriadpro]
     \definefontsynonym [Sans] [file:MyriadPro-Regular.otf]  
[features=default]
     \definefontsynonym [SansItalic] [file:MyriadPro-It.otf] 
   [features=default]
     \definefontsynonym [SansBold]   [file:MyriadPro-Bold.otf] 
   [features=default]
     \definefontsynonym [SansBoldItalic] [file:MyriadPro-BoldIt.otf] 
   [features=default]
     \definefontsynonym [SansSlanted]    [file:MyriadPro-It.otf] 
   [features=default]
     \definefontsynonym [SansBoldSlanted]    [file:MyriadPro-BoldIt.otf] 
   [features=default]


     \definefontsynonym [SansEmboldened] [Sans] [features=emboldened]
     \definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x61-0x7a] [rscale=.8,force=yes] % offset?


     \definefontsynonym [SansCaps] [file:MyriadPro-Regular.otf]  
[fallbacks=FakeSansCaps]

   \stoptypescript
   \starttypescript [myriadpro]
     \definetypeface [myriadpro] [ss] [sans]  [myriadpro] [default]
   \stoptypescript

\stoptypescriptcollection

\usetypescript[myriadpro]

\setupbodyfont[myriadpro,ss]

\starttext
   % scaled up 4 times to appreciate the thickness compensation
   \scale[sx=4,sy=4]{\sc SoMe CaMeLcAsE TeXt.}\par
\stoptext

'offset' offsets the original, i'll add 'target' so that you can do

\definefontfallback[FakeSansCaps]   [SansEmboldened] 
[0x61-0x7a] [rscale=.8,force=yes,target=0x41]





-
  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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___