Page 1 of 1
A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 3:09 pm
by richmond62
Devanagari (the dominant systems used for writing
Sanskrit)
has 2 sets of vowel signs for the same 4 vowels;
see above, left and right of the divider.
Now this, in programming terms is a "pain in the bum"
if one wants to conform to the
Unicode standard because
one must EITHER have the forms on the left or those on
the right inwith one's font.
And one, then, "calls" each one in
LiveCode like so:
put numToCodePoint(0x0905)
There two ways to offer "punters" a choice between the 2 forms:
1. Position one set of forms in a part of the
Personal Private Plain of
the
Unicode thing and then call it using different Hex codes.
2. Develop a
Multiple Master font with the variant forms on a design axis . . .
However, as far as I am aware there is no way that
LiveCode can access
design coordinates in a
Multiple Master font.
Full
Multiple Master font compliance requires a
Multiple Master font.
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 4:15 pm
by LCMark
Unfortunately I think 'multiple master fonts' are a dead-end - e.g.
https://forums.adobe.com/thread/395592.
There is a modern variant just starting to appear
https://www.commarts.com/columns/variab ... generation.
However, my reading of both multiple master and the new variable fonts is that the purpose is not to allow variation in glyph presentation per-se, but to allow a single font file to contain multiple 'styles' - i.e. bold, condensed, expanded etc.
I *think* what you want is probably better handled by 'variation selectors'. Basically there is a mechanism within Unicode to allow a font to contain multiple glyph forms for the same underling abstract form (e.g. letter, although obviously in this case we aren't dealing with something as 'straight-forward' as roman-like scripts) and it *sounds* like this is a case of that. Here are some resources which might help understand what they are all about:
http://unicode.org/faq/vs.html
http://babelstone.blogspot.co.uk/2007/0 ... ctors.html
https://en.wikipedia.org/wiki/Variant_form_(Unicode)
What isn't clear to me upon scanning those is whether it is possible to define 'private use' type variation selectors - i.e. how much of the decision as to how the selectors work can be encoded in a font without system support...
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 4:39 pm
by richmond62
Thank you very much LCMark: off to do some reading.
I was wondering whether there was a way to leverage start using font file . . .
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 4:48 pm
by LCMark
@richmond62: 'start using font file' is a better version of 'revFontLoad' - it just allows you to load an truetype/opentype font into the current process so you can use it as 'textFont'.
If you were meaning in terms of multiple master fonts - then they always required a user managed step by using a special (Adobe!) management app to 'generate' the required concrete fonts with the variations on the axes you required (the support was built into Adobe DTP products).
In theory, you could still generate an instance of a multiple-master font if someone has written something which does what that tool used to do - but that would just mean you had two fonts - one for one set of variations and one for the other - which you could do anyway by setting the textFont of the runs you want in one variation or another to different fonts (with the different glyphs).
I'm guessing you want to be able to 'encode' the variations in the strings themselves - so you can choose in one sentence (if that makes sense) mixtures of vowel sign glyphs.
Note: That might still be an option - have two fonts with the different variations and then select them using textFont on the runs. You could 'encode' the selection in your string - but it would need to be processed into 'styled text' to make it appear the way you intended. Variation selectors *might* allow you to do that - without having to do the selection logic yourself - at the expense of having to construct a special font.
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 5:55 pm
by richmond62
Having done some reading on Variation Selectors (mainly over in the Mongolian department:
https://www.unicode.org/charts/PDF/U11660.pdf
and here:
https://www.unicode.org/charts/PDF/UE0100.pdf
I understand how one accesses a variant is by combining a Unicode address with
one of the Variation Selectors, as the dox say:
"182A 180B"
But this:
Code: Select all
on mouseUp
put numToCodePoint(0x905 0xFE00) into fld "ff"
end mouseUp
throws a bluey

- bMeanie.jpg (9.26 KiB) Viewed 10554 times
as does this:
Code: Select all
on mouseUp
put numToCodePoint(0x905 FE00) into fld "ff"
end mouseUp
and this:
Code: Select all
on mouseUp
put numToCodePoint(2309 65024) into fld "ff"
end mouseUp
So there goes my plans to write an app to write home to Mum in Mongolian.

- blackMeanie.png (6.33 KiB) Viewed 10552 times
Serious Blech!
https://4eyedgal.wordpress.com/2016/03/ ... el-gerber/
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 6:14 pm
by LCMark
@richmond62: If I understand correctly then variation selectors are no different from any other unicode codepoint - so if you want to encode more than one in a sequence, then you have to do so with separate numToCodepoint's... i.e.
Code: Select all
put numToCodepoint(0x905) & numToCodepoint(0xFE00) into field "ff"
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 6:20 pm
by richmond62
Code: Select all
put numToCodepoint(0x905) & numToCodepoint(0xFE00) into field "ff"
produced the "blackMeanie" picture.

Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 6:27 pm
by LCMark
One thing to consider is that variation selectors are *really* new in Unicode relatively speaking - so you need to be on a recent version of any OS for them to work. I tried you code here (macOS 10.12) and I get just the Mongolian glyph - no VS-1 selector overlaid... Which suggests this version of macOS at least 'knows' about variation selectors.
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 6:30 pm
by richmond62

- MTTIW.png (13.36 KiB) Viewed 10538 times
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 6:34 pm
by richmond62
this version of macOS at least 'knows' about variation selectors.
Totally Groovy
But I am catering to people who have a wide range of machines (and if one wants to talk about "axes" now's the time to do it) from Windows XP, Mac OS 10.7 and Oldish 32-bit Linux distros through to the latest and greatest (which is, after all, a moving target).
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 6:51 pm
by LCMark
Hehe - you do like to make things difficult, don't you @richmond62
With those constraints, and I'm guessing you aren't wanting to cobble together your own typesetting stack (and integrate it into the engine) - I suggest the two different fonts, and changing the textFont might be the 'best' solution - you can still export a version using variation selectors for those running on systems which support them, but otherwise they'll have to cope with some sort of styled text output (e.g. rtf) which can encode the appropriate font over the appropriate runs.
Re: A quick lesson in Sanskrit orthography
Posted: Tue Apr 03, 2018 7:08 pm
by richmond62
you do like to make things difficult
Now what, Oh what, could make you think that?
Don't you feel sorry for all the millions of people
who write letters home to Mum in Sanskrit every week?

Re: A quick lesson in Sanskrit orthography
Posted: Wed Apr 04, 2018 8:20 am
by richmond62
changing the textFont might be the 'best' solution
Yes, you are certainly right IFF one is exporting one's end-product to PDF
or an image format.
It might however, play "merry hell" if exporting to RTF or HTML as it
presupposes the end-user has ALL one's family of variant fonts on their system.
Re: A quick lesson in Sanskrit orthography
Posted: Fri Aug 31, 2018 11:46 am
by richmond62
Well, at long last I have circumvented the variation selector problem by working out
how to allow my Devawriter Pro to use 2 fonts (ones that are "the same, but different", with the variants)
at the same time.
What is now "rubbing me up the wrong way" is the way that LiveCode seems to rely on certain aspects of
the underlying OS to decide whether it can display a Unicode glyph or not . . .
Certain glyphs that display perfectly correctly in LC on Linux just come out as "orrible squares" on MacOS.
I wonder if there is a way to circumvent this?