ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* If a Font Has Ligature Glyphs But No Feature?
@ 2022-07-20  4:31 Michael Urban via ntg-context
  2022-07-20  8:19 ` Hans Hagen via ntg-context
  2022-07-20 19:40 ` Bruce Horrocks via ntg-context
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Urban via ntg-context @ 2022-07-20  4:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Michael Urban

I downloaded something that purports to be Century Expanded from fontsgeek.com.   Although the font has fi and fl ligature glyphs, it does not have a ligature font feature and ConTeXt does not use those glyphs.

Aside from purchasing a real font product from Linotype at enormous expense and hoping it is better equipped, is there a way to coerce ConTeXt into using the ligature glyphs for fi and fl?


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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: If a Font Has Ligature Glyphs But No Feature?
  2022-07-20  4:31 If a Font Has Ligature Glyphs But No Feature? Michael Urban via ntg-context
@ 2022-07-20  8:19 ` Hans Hagen via ntg-context
  2022-07-20 19:40 ` Bruce Horrocks via ntg-context
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen via ntg-context @ 2022-07-20  8:19 UTC (permalink / raw)
  To: Michael Urban via ntg-context; +Cc: Hans Hagen

On 7/20/2022 6:31 AM, Michael Urban via ntg-context wrote:
> I downloaded something that purports to be Century Expanded from fontsgeek.com.   Although the font has fi and fl ligature glyphs, it does not have a ligature font feature and ConTeXt does not use those glyphs.
> 
> Aside from purchasing a real font product from Linotype at enormous expense and hoping it is better equipped, is there a way to coerce ConTeXt into using the ligature glyphs for fi and fl?
you can define your own ligature feature (examples in test suite and 
elsewhere) but personally i'd not spend money on a font that is half 
done (some t1 font converted to ot?); or maybe it does have a feature 
but it's script / language dependent

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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: If a Font Has Ligature Glyphs But No Feature?
  2022-07-20  4:31 If a Font Has Ligature Glyphs But No Feature? Michael Urban via ntg-context
  2022-07-20  8:19 ` Hans Hagen via ntg-context
@ 2022-07-20 19:40 ` Bruce Horrocks via ntg-context
  2022-07-20 21:11   ` Henning Hraban Ramm via ntg-context
  2022-07-21  7:02   ` Hans Hagen via ntg-context
  1 sibling, 2 replies; 6+ messages in thread
From: Bruce Horrocks via ntg-context @ 2022-07-20 19:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Bruce Horrocks, Michael Urban



> On 20 Jul 2022, at 05:31, Michael Urban via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Aside from purchasing a real font product from Linotype at enormous expense and hoping it is better equipped, is there a way to coerce ConTeXt into using the ligature glyphs for fi and fl?

Yes - I had to do the same for a font called Venetian 301 for which I found these 4 files:

Filename			Name as it appears to MacOS
--------			--------------------------
Venetian301BT-Roman.otf		Venetian 301 Regular
Venetian301BT-Italic.otf	Venetian 301 Italic
Venetian301BT-Bold.otf		Venetian 301 Bold
venetian-301-demi-bt.ttf	Venetian Dm BT Demi

They each had the fi and fl ligatures, but at different character positions depending on which file, and they weren't recognised by default. So I used the following code to add them (and add en and em dash substitution as well).

%% ---- start
\startluacode
    fonts.handlers.otf.addfeature {
        name = "v1",	-- these character substitutions will be applied to venetian-301-demi-bt
        type = "ligature",
        data = {
            [0xF001] = { "f", "i" },
            [0xF002] = { "f", "l" },
        }
    }
    fonts.handlers.otf.addfeature {
        name = "v2",	-- these character substitutions will be applied to Venetian301BT
        type = "ligature",
        data = {
            [0xFB01] = { "f", "i" },
            [0xFB02] = { "f", "l" },
        }
    }
    fonts.handlers.otf.addfeature {
        name = "v3",	-- these character substitutions will be applied to both
        type = "ligature",
        data = {
            [0x2013] = { "-", "-" },      -- en dash
            [0x2014] = { "-", "-", "-" }, -- em dash
        }
    }
\stopluacode
\definefontfeature [venetian-301-demi-ligatures] [v1=yes,v3=yes]
\definefontfeature [venetian-301-BT-ligatures]   [v2=yes,v3=yes]

\starttypescript [serif] [myBookFont]
  \definefontsynonym [Serif]       [file:venetian-301-demi-bt] [features=venetian-301-demi-ligatures]
  \definefontsynonym [SerifBold]   [file:Venetian301BT-Bold]   [features=venetian-301-BT-ligatures]
  \definefontsynonym [SerifItalic] [file:Venetian301BT-Italic] [features=venetian-301-BT-ligatures]
\stoptypescript
%% ---- end

Note that the names v1, v2 and v3 are entirely arbitrary. Also, the \starttypescript section sets the font features to be just those I've defined - potentially losing whatever 'default' would provide. But since the font doesn't seem to have a lot of features in the first place I've so far not noticed any problems. I'm sure a real expert could tell you how to retain 'default' and add the ligatures, if needed.

Regards,
—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: If a Font Has Ligature Glyphs But No Feature?
  2022-07-20 19:40 ` Bruce Horrocks via ntg-context
@ 2022-07-20 21:11   ` Henning Hraban Ramm via ntg-context
  2022-07-20 22:48     ` Bruce Horrocks via ntg-context
  2022-07-21  7:02   ` Hans Hagen via ntg-context
  1 sibling, 1 reply; 6+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-07-20 21:11 UTC (permalink / raw)
  To: ntg-context; +Cc: Henning Hraban Ramm

Am 20.07.22 um 21:40 schrieb Bruce Horrocks via ntg-context:

> \definefontfeature [venetian-301-demi-ligatures] [v1=yes,v3=yes]
> \definefontfeature [venetian-301-BT-ligatures]   [v2=yes,v3=yes]
> 
> Note that the names v1, v2 and v3 are entirely arbitrary. Also, the \starttypescript section sets the font features to be just those I've defined - potentially losing whatever 'default' would provide. But since the font doesn't seem to have a lot of features in the first place I've so far not noticed any problems. I'm sure a real expert could tell you how to retain 'default' and add the ligatures, if needed.

Hi Bruce, you can simply inherit your feature sets from default:

\definefontfeature [venetian-301-demi-ligatures][default][v1=yes,v3=yes]
\definefontfeature [venetian-301-BT-ligatures][default][v2=yes,v3=yes]

I’d like to borrow your example for my book, if you don’t object.

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: If a Font Has Ligature Glyphs But No Feature?
  2022-07-20 21:11   ` Henning Hraban Ramm via ntg-context
@ 2022-07-20 22:48     ` Bruce Horrocks via ntg-context
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Horrocks via ntg-context @ 2022-07-20 22:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Bruce Horrocks



> On 20 Jul 2022, at 22:11, Henning Hraban Ramm via ntg-context <ntg-context@ntg.nl> wrote:
> 
> Am 20.07.22 um 21:40 schrieb Bruce Horrocks via ntg-context:
> 
>> \definefontfeature [venetian-301-demi-ligatures] [v1=yes,v3=yes]
>> \definefontfeature [venetian-301-BT-ligatures]   [v2=yes,v3=yes]
>> Note that the names v1, v2 and v3 are entirely arbitrary. Also, the \starttypescript section sets the font features to be just those I've defined - potentially losing whatever 'default' would provide. But since the font doesn't seem to have a lot of features in the first place I've so far not noticed any problems. I'm sure a real expert could tell you how to retain 'default' and add the ligatures, if needed.
> 
> Hi Bruce, you can simply inherit your feature sets from default:
> 
> \definefontfeature [venetian-301-demi-ligatures][default][v1=yes,v3=yes]
> \definefontfeature [venetian-301-BT-ligatures][default][v2=yes,v3=yes]
> 
> I’d like to borrow your example for my book, if you don’t object.

Thank-you for the tip, and please feel free to use my example in your book.

—
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: If a Font Has Ligature Glyphs But No Feature?
  2022-07-20 19:40 ` Bruce Horrocks via ntg-context
  2022-07-20 21:11   ` Henning Hraban Ramm via ntg-context
@ 2022-07-21  7:02   ` Hans Hagen via ntg-context
  1 sibling, 0 replies; 6+ messages in thread
From: Hans Hagen via ntg-context @ 2022-07-21  7:02 UTC (permalink / raw)
  To: Bruce Horrocks via ntg-context; +Cc: Hans Hagen

On 7/20/2022 9:40 PM, Bruce Horrocks via ntg-context wrote:
> 
> 
>> On 20 Jul 2022, at 05:31, Michael Urban via ntg-context <ntg-context@ntg.nl> wrote:
>>
>> Aside from purchasing a real font product from Linotype at enormous expense and hoping it is better equipped, is there a way to coerce ConTeXt into using the ligature glyphs for fi and fl?
> 
> Yes - I had to do the same for a font called Venetian 301 for which I found these 4 files:
> 
> Filename			Name as it appears to MacOS
> --------			--------------------------
> Venetian301BT-Roman.otf		Venetian 301 Regular
> Venetian301BT-Italic.otf	Venetian 301 Italic
> Venetian301BT-Bold.otf		Venetian 301 Bold
> venetian-301-demi-bt.ttf	Venetian Dm BT Demi
> 
> They each had the fi and fl ligatures, but at different character positions depending on which file, and they weren't recognised by default. So I used the following code to add them (and add en and em dash substitution as well).
> 
> %% ---- start
> \startluacode
>      fonts.handlers.otf.addfeature {
>          name = "v1",	-- these character substitutions will be applied to venetian-301-demi-bt
>          type = "ligature",
>          data = {
>              [0xF001] = { "f", "i" },
>              [0xF002] = { "f", "l" },
>          }
>      }
>      fonts.handlers.otf.addfeature {
>          name = "v2",	-- these character substitutions will be applied to Venetian301BT
>          type = "ligature",
>          data = {
>              [0xFB01] = { "f", "i" },
>              [0xFB02] = { "f", "l" },
>          }
>      }
>      fonts.handlers.otf.addfeature {
>          name = "v3",	-- these character substitutions will be applied to both
>          type = "ligature",
>          data = {
>              [0x2013] = { "-", "-" },      -- en dash
>              [0x2014] = { "-", "-", "-" }, -- em dash
>          }
>      }
> \stopluacode
> \definefontfeature [venetian-301-demi-ligatures] [v1=yes,v3=yes]
> \definefontfeature [venetian-301-BT-ligatures]   [v2=yes,v3=yes]
> 
> \starttypescript [serif] [myBookFont]
>    \definefontsynonym [Serif]       [file:venetian-301-demi-bt] [features=venetian-301-demi-ligatures]
>    \definefontsynonym [SerifBold]   [file:Venetian301BT-Bold]   [features=venetian-301-BT-ligatures]
>    \definefontsynonym [SerifItalic] [file:Venetian301BT-Italic] [features=venetian-301-BT-ligatures]
> \stoptypescript
> %% ---- end
> 
> Note that the names v1, v2 and v3 are entirely arbitrary. Also, the \starttypescript section sets the font features to be just those I've defined - potentially losing whatever 'default' would provide. But since the font doesn't seem to have a lot of features in the first place I've so far not noticed any problems. I'm sure a real expert could tell you how to retain 'default' and add the ligatures, if needed.
just name them 'liga' and default will then do them


-----------------------------------------------------------------
                                           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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2022-07-21  7:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20  4:31 If a Font Has Ligature Glyphs But No Feature? Michael Urban via ntg-context
2022-07-20  8:19 ` Hans Hagen via ntg-context
2022-07-20 19:40 ` Bruce Horrocks via ntg-context
2022-07-20 21:11   ` Henning Hraban Ramm via ntg-context
2022-07-20 22:48     ` Bruce Horrocks via ntg-context
2022-07-21  7:02   ` Hans Hagen via ntg-context

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