Open 10kalden opened 6 months ago
https://www.calligraphr.com/en/webapp/app_home/?/
According to my research, I found two ways to include the variant glyph in the font.
Stylistic Set using the OTF feature Stylistic set, we can create stylistic sets for different print styles. it will group the alternate glyphs. but using this requires manually changing the stylistic set according to need when using a word processor like MS Word. Randomization could be possible through the scripting method. https://typedrawers.com/discussion/1357/how-can-i-randomize-letters-in-a-typeface https://graphicdesign.stackexchange.com/questions/11342/how-does-random-choice-of-alternate-characters-work-in-opentype-fonts
Contextual Alternate currently modifying the pipeline to add glyphs as contextual alternates using the OTF feature, I will test with this method to randomize the glyphs. https://forum.glyphsapp.com/t/stylistic-alternates-vs-contextual-alternatives/13478
successfully added all the glyph variants as contextual alternates in the font, needs testing
this image is from FontLab to visualise all the glyphs in the font
need to write the rules to specify when to substitute glyphs to define Calt feature, need to think about it.
I tried using this rule, not working
the Calt feature rules are defined like this
``` feature calt {
# Substitute 'a.alt1' for 'a' when 'a' is followed by 'b'
sub a' b by a.alt1;
# Substitute 'a.alt2' for 'a' when 'a' is followed by 'c'
sub a' c by a.alt2;
# Add more rules as needed...
} calt;
issue#01: added a rule for simulating randomness, but it replaced the already present rule in the existing font for ligature replacement. sol#01:
rules for ligature replacement
font link to single gylph and variation glyph: https://drive.google.com/drive/u/0/folders/1vqTJJ4ThcGckN1OtfUyheJZkYq2ggIOY
@10kalden What is the reason you are not creating a font from scratch?
It looks like you are running into limitations with existing fonts though, you don't have enough codepoints and it seems like you also have issues with ligatures. Can you give it a try? Now you are quite familiar with font building and you can get help from ChatGPT or Gemini. If you ask AI to give you code one step at a time you'll get good results.
You can try to use the command line of fontforge from python scripts if you don't get much luck with fonttools (by asking AI to write the code to start of course).
A few months ago I did some tests with the help of perplexity.ai and got very good results. We shouldn't be limited by the number of codepoints of old fonts.
Here's a sample chat with Gemini to give your an idea of what I mean: https://gemini.google.com/share/6e511e00b17e.
You can also ask for alternative approaches like https://gemini.google.com/share/9403ff9c1343.
@ngawangtrinley Yes, I was running into issues with the variants due to the limitations of the lookup table of the existing font.
I will make the font without using an existing font. I have already started with the script. I get help from AI also.
to solve the spacing issue, we need to adjust the advance width advance width = glyph width + lsb + rsb
@ngawangtrinley hello, I set up a font file using python, but i am running into various issues when setting up some tables by using fonttools. I found an empty font file its called AdobeBlank.ttf(kind of like a templete). I was thinking if we can add all the glyph to this font, set our own metrics. what do you think of this approach. it'll solve the limitation issue. If not, I will try using the Fontforge CLI.
UPDATE: found a way to make font from scratch without using a blank font
update: got suggestion on font forum to use the method of blank font files, used adobeblank.ttf and created font form scratch.
got more information about creating a font without using Adobe Blank, using fontbuilder class, tried it this morning and created a font from scratch without taking any blank font. need to test which is better and will take suggestions.
@kaldan007 font for testing https://github.com/OpenPecha/create-font-from-glyph/tree/feature/font-from-scratch/fonts/derge_font
Blocker:
Description: The objective of the task is to create a digital font from the print font of the major publishers such as Derge, Pecing and Shul by taking 10 glyphs of each Tibetan character. The font creation process is previously implemented by taking one random glyph for each Tibetan character.
Since The Derge Pechas are printed on wooden blocks, there are many variations for the same Tibetan characters and ligature. To include all the variations of the characters and ligatures in the font, 10 glyphs from each character are taken in the font creation process.
Completion Criteria: Fully completed font in TTF format with most of the variation of the character included.
Font files: https://drive.google.com/drive/folders/1vqTJJ4ThcGckN1OtfUyheJZkYq2ggIOY?usp=drive_link
Implementation Plan:
Sub-task:
[x] Modify the pipeline to download 10 random glyphs
[x] Process all the images
[x] Explore font creation software to study the glyph randomizing mechanism for character variation
[x] Do RnD for OTF feature to include the variation in the Tibetan glyphs
[x] Create the font for the desired publication with all the character variations included
Due to the limitation of cycling through the glyph variant in font created by using existing font, an alternate approach to create font without using existing font is being implemented.
Sub-task: