jsPDF non Latin letters - jspdf

I'm trying to create a table with jsPDF , my table contain non Latin words and they come out look like gibberish.
I tried add the language and changing the font but nothing worked.
doc.addFont('notosans-fontface')
doc.setFont('notosans-fontface')
doc.setLanguage('ar')

Related

Remove bold style from japanese characters

I am generating one PDF in ruby on rails
filename is abc.html.haml
the file contains Japanese characters that I have copied from a word document.
Now the problem is that some Japanese characters in pdf are displayed with bold style but I have not added any Style or CSS for the characters.
This makes my PDF look uneven some characters are normal some are bold.
If anyone can help me
Thank you in advance
As it can be seen in screenshot some characters are bold

Arabic text rendering with Skia (SkiaSharp)

I'm rendering text with SkiaSharp for various platforms. I have problem with arabic script. I've created simple shaping routine and I have nicely connected glyphs. But diacritics is off completely.
Is there an easy way how to render/position diacritics? Like another table, which tells that after this char, put this glyph which represent diacritics in middle position, or something like that.
I'have tried HarfBuzzSharp, it's working ok, except Android (where it is returning zeros to all glyph positions).

Multiple fonts on a single line of an eps file?

I'm trying to manipulate and modify a large number of eps files output by a web service. I have the code in python to interface with the server, and to edit the images to within about 99% of where I want them.
My issue deals with trying to display special characters. I've tried outputting the desired unicode character, Ψ, directly into the eps file, but this is displayed as different characters in both Preview for Mac and Adobe Illustrator. From some googling, it seems like eps doesn't accept unicode characters. Fair enough...
My current solution is to try to change the font in the eps files. This works when I want to display the Ψ as a single character. I just switch the font, and then switch back. As below:
/Symbol findfont 10.5 scalefont setfont
-9.1 36.1557 moveto (Y) show
/Helvetica-Bold findfont 10.5 scalefont setfont
Where I'm having a problem is when I want to display a title on each image. The title would include a mix of Helvetica-Light and Symbol fonts, I would want it to display as ABC1-Ψ123. I can't figure out how to switch the font of a single character within a larger block of text. Currently the eps files are written as shown:
/Helvetica-Light findfont 12 scalefont setfont
-43.093 304.224 moveto (ABC1-Y123) show
I'd appreciate any help.

How do I apply a GREP style a "$" before the first ENSH and nothing after?

Important: a "$" before the first ENSH is optional.
New to GREP. I work on retail ads and trying to figure out how to accommodate client styling rules in my existing paragraph styles. Currently, we use multiple ENSH's to switch character styles in our listings.
So far, no matter what I do, I can only get the style to apply all "$." Below is what I am trying to create with my paragraph style.
Example:
2/$4.00 [ENSH] product name [ENSH] after xx/xx/xxxx 2/$5.00
(character style 1 [ENSH] character style 2 [ENSH] character style 3)
The "$" in the example above needs to end up superscripted via GREP (apply new character style). I can't just apply to all dollar signs in the string because subsequent "$" after the first ENSH need to remain the same character style as the the text in the respective portion of the string.
Thanks for your help!
Create the first character style
Create a superscript character style say "dollar" that will inherit from the first character style
Create second character style
Create last character style
Use screenshot settings to apply styles.
Then the idea is :
1. Create a "normal" character style
2. Create the first character style (green)
3. Create a superscript character style say "dollar" that will inherit from the first character style
4. Create second character style (red)
5. Create last character style (blue)
add Grep styles like \$ => dollar
That will apply to all $'s.
add Grep style so teh last segment with dollar will have a normal style
add other grep styles.
HTH

Porting Arabic font to iOS System

I am just looking to get a better look for my iPad using custom font.
The default Arabic font for iOS8 devices is GeezaPro. and it's in .ttc format.
I am trying to replace it with my custom font.
I use DOSBOX to break system font ttc file into ttf files to make them editable.
Then i use FontLab Studio to replace system font glyphs with my custom font glyphs.
I just copy the glyph from custom font and paste them in the system font (using special paste option FontLab provide).
Then i use DOSBOX again to join these ttf files into ttc file.
That's worked for custom English fonts i used. but using it with arabic fonts show some issues.
The text letters appear separated in iOS apps and everywhere.(as you already know that Arabic language use joined letters and sometimes separated letters depending on the context. if the letter is the first letter it will use specific glyph, the same goes if the letter is in the middle or in the end using different glyph. while in English all letters are always remain separated no matter what. except for handwritten scripts.)
any idea how to fix?
some links:
tutorial I followed to port my fonts
the arabic font I am trying to accomplish (it's free and legit)
P.S: some may say use Bytafont library of fonts but i want to use this specific font. and arabic fonts also limited in the library (20 font only available).
Fonts are complex programs that run on embedded hardware interpreters and font engines (the same way game ROMs run on game hardware or in emulators), and don't just contain the pictures for each letter, but also all the instructions on how to position, combine, and substitute those letters based on what sequence of input it's being told to process.
For almost every font, just copying the glyph outlines is not enough, you also need to make sure that:
the original font's glyph ordering is preserved,
the GPOS table gets copied over (which determines mark positioning, kerning, etc), and
the GSUB table gets copied over (which handles glyph substitution, without which you can't even write Arabic. As an example, you need ـب, ـبـ, بـ or ب depending on context for the same "letter" bā’)
So you generally want to unpack the TTC (which as of OpenType 1.7 can be either truetype or postscript/type2, so that's a thing to remember for the future), then perform the replacements of glyphs (with order-preservation), as well as replacing the GPOS and GSUB tables (using FontForge or TTX) and then pack it back up into the TTC.

Resources