ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* faking smallcaps font with font features and fallbacks
@ 2018-10-03 10:33 mf
  2018-10-03 13:29 ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: mf @ 2018-10-03 10:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-03 10:33 faking smallcaps font with font features and fallbacks mf
@ 2018-10-03 13:29 ` Hans Hagen
  2018-10-03 14:02   ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2018-10-03 13:29 UTC (permalink / raw)
  To: mf, ntg-context@ntg.nl >> mailing list for ConTeXt users

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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-03 13:29 ` Hans Hagen
@ 2018-10-03 14:02   ` Hans Hagen
  2018-10-03 14:20     ` mf
  2018-10-04 11:44     ` Taco Hoekwater
  0 siblings, 2 replies; 17+ messages in thread
From: Hans Hagen @ 2018-10-03 14:02 UTC (permalink / raw)
  To: mf, ntg-context@ntg.nl >> mailing list for ConTeXt users

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] 
[0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-03 14:02   ` Hans Hagen
@ 2018-10-03 14:20     ` mf
  2018-10-03 14:31       ` Hans Hagen
  2018-10-04 11:44     ` Taco Hoekwater
  1 sibling, 1 reply; 17+ messages in thread
From: mf @ 2018-10-03 14:20 UTC (permalink / raw)
  To: ntg-context@ntg.nl >> mailing list for ConTeXt users

Il 03/10/18 16:02, Hans Hagen ha scritto:
> ok, even nicer:
> 
>          \definefontfallback[FakeSansCaps]   [SansEmboldened] 
> [0x0000-0xFFFF] [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 0x0000-0xFFFF 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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-03 14:20     ` mf
@ 2018-10-03 14:31       ` Hans Hagen
  2018-10-03 15:16         ` mf
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2018-10-03 14:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users, mf

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] 
>> [0x0000-0xFFFF] [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 0x0000-0xFFFF 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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-03 14:31       ` Hans Hagen
@ 2018-10-03 15:16         ` mf
  2018-10-03 16:59           ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: mf @ 2018-10-03 15:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

\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] 
[0x0000-0xFFFF] [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

[-- Attachment #2: fake-smallcaps.pdf --]
[-- Type: application/pdf, Size: 6746 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: fake-smallcaps.tex --]
[-- Type: text/x-tex; name="fake-smallcaps.tex", Size: 1485 bytes --]

\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] [0x0000-0xFFFF] [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

[-- Attachment #4: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-03 15:16         ` mf
@ 2018-10-03 16:59           ` Hans Hagen
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Hagen @ 2018-10-03 16:59 UTC (permalink / raw)
  To: ntg-context

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] 
> [0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-03 14:02   ` Hans Hagen
  2018-10-03 14:20     ` mf
@ 2018-10-04 11:44     ` Taco Hoekwater
  2018-10-04 12:11       ` Hans Hagen
  1 sibling, 1 reply; 17+ messages in thread
From: Taco Hoekwater @ 2018-10-04 11:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

> ok, even nicer:
> 
>        \definefontfallback[FakeSansCaps]   [SansEmboldened] [0x0000-0xFFFF] [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] [0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 11:44     ` Taco Hoekwater
@ 2018-10-04 12:11       ` Hans Hagen
  2018-10-04 13:19         ` Taco Hoekwater
  2018-10-04 13:35         ` mf
  0 siblings, 2 replies; 17+ messages in thread
From: Hans Hagen @ 2018-10-04 12:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Taco Hoekwater

On 10/4/2018 1:44 PM, Taco Hoekwater wrote:
> Hi,
> 
>> ok, even nicer:
>>
>>         \definefontfallback[FakeSansCaps]   [SansEmboldened] [0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 12:11       ` Hans Hagen
@ 2018-10-04 13:19         ` Taco Hoekwater
  2018-10-04 13:46           ` Hans Hagen
  2018-10-04 13:35         ` mf
  1 sibling, 1 reply; 17+ messages in thread
From: Taco Hoekwater @ 2018-10-04 13:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> On 4 Oct 2018, at 14:11, Hans Hagen <j.hagen@xs4all.nl> wrote:
> 
> On 10/4/2018 1:44 PM, Taco Hoekwater wrote:
>> Hi,
>>> ok, even nicer:
>>> 
>>>        \definefontfallback[FakeSansCaps]   [SansEmboldened] [0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 12:11       ` Hans Hagen
  2018-10-04 13:19         ` Taco Hoekwater
@ 2018-10-04 13:35         ` mf
  2018-10-04 13:45           ` Hans Hagen
  2018-10-04 13:47           ` luigi scarso
  1 sibling, 2 replies; 17+ messages in thread
From: mf @ 2018-10-04 13:35 UTC (permalink / raw)
  To: ntg-context

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] 
>>> [0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 13:35         ` mf
@ 2018-10-04 13:45           ` Hans Hagen
  2018-10-04 14:10             ` mf
  2018-10-04 13:47           ` luigi scarso
  1 sibling, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2018-10-04 13:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users, mf

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] 
>>>> [0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 13:19         ` Taco Hoekwater
@ 2018-10-04 13:46           ` Hans Hagen
  2018-10-04 14:26             ` Taco Hoekwater
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2018-10-04 13:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Taco Hoekwater

On 10/4/2018 3:19 PM, Taco Hoekwater wrote:
> 
> 
>> On 4 Oct 2018, at 14:11, Hans Hagen <j.hagen@xs4all.nl> wrote:
>>
>> On 10/4/2018 1:44 PM, Taco Hoekwater wrote:
>>> Hi,
>>>> ok, even nicer:
>>>>
>>>>         \definefontfallback[FakeSansCaps]   [SansEmboldened] [0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 13:35         ` mf
  2018-10-04 13:45           ` Hans Hagen
@ 2018-10-04 13:47           ` luigi scarso
  1 sibling, 0 replies; 17+ messages in thread
From: luigi scarso @ 2018-10-04 13:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

On Thu, Oct 4, 2018 at 3:35 PM mf <massifr@fastwebnet.it> 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

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

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 13:45           ` Hans Hagen
@ 2018-10-04 14:10             ` mf
  2018-10-04 14:38               ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: mf @ 2018-10-04 14:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 13:46           ` Hans Hagen
@ 2018-10-04 14:26             ` Taco Hoekwater
  0 siblings, 0 replies; 17+ messages in thread
From: Taco Hoekwater @ 2018-10-04 14:26 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Hi,

> On 4 Oct 2018, at 15:46, Hans Hagen <j.hagen@xs4all.nl> wrote:
> 
> On 10/4/2018 3:19 PM, Taco Hoekwater wrote:
>>> On 4 Oct 2018, at 14:11, Hans Hagen <j.hagen@xs4all.nl> wrote:
>>> 
>>> On 10/4/2018 1:44 PM, Taco Hoekwater wrote:
>>>> Hi,
>>>>> ok, even nicer:
>>>>> 
>>>>>        \definefontfallback[FakeSansCaps]   [SansEmboldened] [0x0000-0xFFFF] [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
___________________________________________________________________________________

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

* Re: faking smallcaps font with font features and fallbacks
  2018-10-04 14:10             ` mf
@ 2018-10-04 14:38               ` Hans Hagen
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Hagen @ 2018-10-04 14:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users, mf

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
___________________________________________________________________________________

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

end of thread, other threads:[~2018-10-04 14:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 10:33 faking smallcaps font with font features and fallbacks mf
2018-10-03 13:29 ` Hans Hagen
2018-10-03 14:02   ` Hans Hagen
2018-10-03 14:20     ` mf
2018-10-03 14:31       ` Hans Hagen
2018-10-03 15:16         ` mf
2018-10-03 16:59           ` Hans Hagen
2018-10-04 11:44     ` Taco Hoekwater
2018-10-04 12:11       ` Hans Hagen
2018-10-04 13:19         ` Taco Hoekwater
2018-10-04 13:46           ` Hans Hagen
2018-10-04 14:26             ` Taco Hoekwater
2018-10-04 13:35         ` mf
2018-10-04 13:45           ` Hans Hagen
2018-10-04 14:10             ` mf
2018-10-04 14:38               ` Hans Hagen
2018-10-04 13:47           ` luigi scarso

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