Asking context to switch to a different font for a single character in many places
![](https://secure.gravatar.com/avatar/e006e718dd25a3b1f6019eaef0a335a4.jpg?s=120&d=mm&r=g)
Hi, I am trying to prepare a moderate sized document in Malayalam using Context. Overall I have been successful. However, there are a few rough edges for which I need help. This is the fifth problem I face. Is it possible to instruct Context to use a font in general, except for a single character? I want to show the space character with open box,␣ U+2423. However, the font doesn't have that character. The open box character shows up in many places within an otherwise Malayalam text. So, switching font is not possible. For the time being, I am using a substitution. However, I would like to know if it is possible. Thanks, ajith
![](https://secure.gravatar.com/avatar/b04967b5f7eb23e9f63b1357c7e8b3cb.jpg?s=120&d=mm&r=g)
On Friday, December 31, 2021 6:30:26 PM IST Ajith R via ntg-context wrote:
Is it possible to instruct Context to use a font in general, except for a single character?
Since you have mentioned elsewhere that you have \definefontfamily[…] you can set a fallback font family with \definefallbackfamily[…] and choose a font which has the character you want: ⋮ \definefallbackfamily[mainfont][rm][Latin Modern] [range=controlpictures,force=yes] \definefontfamily[mainfont] […] ⋮ \setupbodyfont[mainfont] The 'controlpictures' Unicode block (≡ U+2400 – U+243F) contains the character you want. kauśika
![](https://secure.gravatar.com/avatar/e006e718dd25a3b1f6019eaef0a335a4.jpg?s=120&d=mm&r=g)
On Fri, 31 Dec 2021 20:54:16 +0530
kauśika
On Friday, December 31, 2021 6:30:26 PM IST Ajith R via ntg-context wrote:
Is it possible to instruct Context to use a font in general, except for a single character?
Since you have mentioned elsewhere that you have \definefontfamily[…] you can set a fallback font family with \definefallbackfamily[…] and choose a font which has the character you want:
⋮ \definefallbackfamily[mainfont][rm][Latin Modern] [range=controlpictures,force=yes] \definefontfamily[mainfont] […] ⋮ \setupbodyfont[mainfont]
The 'controlpictures' Unicode block (≡ U+2400 – U+243F) contains the character you want.
kauśika
Hi Kausika, This is what I tried - \definefallbackfamily [mainfont] [rm] [Latin Modern] [range=controlpictures,force=yes] \definefontfamily [mainfont] [rm] [RIT-Rachana] [features=malayalam-two] \setupbodyfont [mainfont] \starttext \title{മലയാളലിപികളുടെ ആവൃത്തി നിർണ്ണയം} ␣ \stoptext This doesn't print the open box. If I remove the definefontfamily command or define font family using only Latin Modern, open box is printed, but not the title. What am I missing? Thanks, ajith
![](https://secure.gravatar.com/avatar/b04967b5f7eb23e9f63b1357c7e8b3cb.jpg?s=120&d=mm&r=g)
On Saturday, January 1, 2022 1:37:49 PM IST Ajith R wrote:
This doesn't print the open box. If I remove the definefontfamily command or define font family using only Latin Modern, open box is printed, but not the title.
What am I missing?
Try with the following: \definefallbackfamily [malayalam] [serif] [TeX Gyre Pagella][range=controlpictures,force=yes] \definefontfamily [malayalam] [serif] [RIT Rachana][features=malayalam-two] \setupbodyfont[malayalam] I have tested that this works on my system. Ensure that the TeX Gyre Pagella font is available on your system (ConTeXt ships with a copy of this font). If it still does not work check the log file for any messages regarding fallback font. kauśika
![](https://secure.gravatar.com/avatar/e006e718dd25a3b1f6019eaef0a335a4.jpg?s=120&d=mm&r=g)
On Sat, 01 Jan 2022 14:28:12 +0530
kauśika
Try with the following:
\definefallbackfamily [malayalam] [serif] [TeX Gyre Pagella][range=controlpictures,force=yes] \definefontfamily [malayalam] [serif] [RIT Rachana][features=malayalam-two]
\setupbodyfont[malayalam]
I have tested that this works on my system. Ensure that the TeX Gyre Pagella font is available on your system (ConTeXt ships with a copy of this font). If it still does not work check the log file for any messages regarding fallback font.
kauśika
Hi Kaushika, Thanks. This is working. But, I don't understand why this is working while the other wasn't even when it could display the open box when it was the solo font defined? Thanks, ajith
![](https://secure.gravatar.com/avatar/e006e718dd25a3b1f6019eaef0a335a4.jpg?s=120&d=mm&r=g)
On Sat, 01 Jan 2022 14:28:12 +0530
kauśika
Try with the following:
\definefallbackfamily [malayalam] [serif] [TeX Gyre Pagella][range=controlpictures,force=yes] \definefontfamily [malayalam] [serif] [RIT Rachana][features=malayalam-two]
\setupbodyfont[malayalam]
I have tested that this works on my system. Ensure that the TeX Gyre Pagella font is available on your system (ConTeXt ships with a copy of this font). If it still does not work check the log file for any messages regarding fallback font.
kauśika
Hi Kaushika, Thanks. This is working. But, I don't understand why this is working while the other wasn't even when it could display the open box when it was the solo font defined? Thanks, ajith
![](https://secure.gravatar.com/avatar/74d41c3215dcdd377343cdc47311757c.jpg?s=120&d=mm&r=g)
Ajith R via ntg-context schrieb am 01.01.2022 um 11:06:
On Sat, 01 Jan 2022 14:28:12 +0530 kauśika
wrote: Try with the following:
\definefallbackfamily [malayalam] [serif] [TeX Gyre Pagella][range=controlpictures,force=yes] \definefontfamily [malayalam] [serif] [RIT Rachana][features=malayalam-two]
\setupbodyfont[malayalam]
I have tested that this works on my system. Ensure that the TeX Gyre Pagella font is available on your system (ConTeXt ships with a copy of this font). If it still does not work check the log file for any messages regarding fallback font.
kauśika Hi Kaushika,
Thanks. This is working. But, I don't understand why this is working while the other wasn't even when it could display the open box when it was the solo font defined?
You used "Latin Modern" which isn't a valid font name, the correct name is "Latin Modern Roman". Wolfgang
![](https://secure.gravatar.com/avatar/e006e718dd25a3b1f6019eaef0a335a4.jpg?s=120&d=mm&r=g)
On Sat, 1 Jan 2022 11:25:34 +0100
Wolfgang Schuster
You used "Latin Modern" which isn't a valid font name, the correct name is "Latin Modern Roman".
Wolfgang
Hi, Thanks for that info. So, when I used "Latin Modern" as the font definition, Context falls back to a system defined default? Was that the reason why in that situation, Context was able to display the open box, though not able to display Malayalam? Thanks, ajith
participants (3)
-
Ajith R
-
kauśika
-
Wolfgang Schuster