jsPDF: custom font so many incorrect words - jspdf

So I was trying out this custom font called devanagari in jsPDF. After adding the font to my library, I tried writing this text in my pdf:
Original text:
पूसीरे के रेसुब ने नाबालिगों समेत 12 लोगों को बचाया
What's being written in my pdf:
Please click here to view
Another text:
एक वर्ष में 686 व्यक्तियों को बचाया, 24 मानव तस्कर गिरफ्तार
What's being written in my pdf:
Please click here to view
As you can see after comparing both the texts, there's ample of spelling mistakes in the photos. I have tried this with another font called SakalBharati. It too gave the same result. Are all the fonts out there have incorrect spellings? How do I fix this?

Related

How to allow all arabic characters to be shown on UITextVIew?

if i have this arabic text: "لِلَّهِ" it looks very weird only Apple devices.
but if i paste the same exact text for example in a google chrome textfield it shows this (which is correct):
What can i do so my UITextView allows all characters regardless of which language/word it is?
You can always download any font you like and just import it into your app. To do that upload .ttf files to project > register fonts in Info.plist file ("Fonts provided by application")
I always use googleFonts to find suitable font for me
I had to change the font to an arabic font style you can download on the web.

Xcode: customize font display wrong style in Xcode storyboard

I added some customize font into my project and want to use it in the storyboard.
The font names are:
Frutiger 45 Light.ttf
Frutiger 55 Roman Bold.ttf
Frutiger 55 Roman.ttf
Then I want to use it in storyborad by selecting an UILabel and set the font.
As you can see in the images, the name Family is Frutiger, but the Style is all Regular.
Is the font file name problem? Tried "Frutiger_55_Roman.ttf" and "Frutiger-55-Roman.ttf" way, not working so far.
Thanks!
Solved by adding my font folder into Font Book in my mac.
According to this post https://stackoverflow.com/a/48927714/291240

TextView's font i not changing in storyboard

as you can see in the above i'm trying to change my textView's font , but it didn't changing i searched some related terms on changing for like this one
and this , but nothing worked for me
i'm also not sure if this is the correct name of my desired font or not
titleTextView.font = UIFont(name: "Myriad-Condensed", size: 25)
even in this site they dont have anything related to my desired font which is Myriad pro Condensed according to storyboard's attribute inspector
anyone faced anything similar to this before ?? or any clue what i should do ? then please let me know
First you need a font to use. Download any of them in you cass its right here : http://ufonts.com/fonts/myriadpro-cond.html
After downloading drag & drop the font file (otf or ttf) into your project
Make sure you check the box next to your target or the font won’t actually get included in your app (even though it’ll probably show in Interface Builder).
Open up the Info.plist . Add a new array of strings to it: “Fonts provided by application”. Add the filenames for each font you want to use as String entries in the array. (That one ttf file you just added to your project )
Now you're good to go , select that font once again like you did in the attached image.
For more detail see this article https://grokswift.com/custom-fonts/

Xcode JSON arabic text black instead of red

I have a project including a JSON file which contains Arabic text.
I copied the text from a Word Document file into the JSON file in Xcode.
As far as I know, the correct bits of text in the JSON file are usually shown in red and
the incorrect bits are shown in black color.
This is what it looks like in Xcode:
There are plenty of parts in my JSON file where text is shown in black, hence it must be incorrect. When I run the app, which should output the arabic text in a tableview, the
tableview is shown as empty.
Thus, there must be a problem with the JSON file.
I also checked it on http://jsonlint.com/ with the JSONLint Validator. It showed me the following error message in the red box at the bottom:
Here is the JSON file containing the Arabic text:
https://www.dropbox.com/s/5gxdqmh2l9lr7cv/MyFavoriteDishes_ARA.json
I don't know how to fix it! It's frustrating. Any help is appreciated!

Self installed fonts have wrong line height in UILabel

I have installed two custom TTF fonts in my iPhone app (Cardo and New Athena Unicode). These are used in a multi-line UILabel, but for some reason the line height seems messed up: the lines have a lot of overlap.
What could cause this? Is it a bug in UILabel, or are the fonts not right? How can I edit or examine the contents of a TTF font file?
It's probably the fonts. Please try changing only the font used in your app. Use an included iOS font. If the label displays correctly by just changing the fonts used, it is the font's fault. If not, post the code so we can track down the problem.
You can edit fonts with a number of programs such as Fontlab, Fontographer, TypeTool, FontForge, etc. As BobC mentions in a comment, there may be licensing issues.

Resources