How can I render hindi correctly when exporting to pdf?
this worked for me IndicLigaturizer hindi = new DevanagariLigaturizer(); String result = hindi.process(string);
this worked for me IndicLigaturizer hindi = new DevanagariLigaturizer(); String result = hindi.process(string);
Either Consolas (download) or Andale Mono (download). I mostly use Andale Mono. I wrote an article about programming fonts a long time ago, I think Consolas wasn’t even out yet. http://www.deadprogrammer.com/photos/fonts.gif I find that typing Illegal1 = O0 is a good test of suitability.
There are a number of font formats that one can set MIME types for, on both Apache and IIS servers. I’ve traditionally had luck with the following: svg as “image/svg+xml” (W3C: August 2011) ttf as “application/x-font-ttf” (IANA: March 2013) or “application/x-font-truetype” otf as “application/x-font-opentype” (IANA: March 2013) woff as “application/font-woff” (IANA: January 2013) woff2 as … Read more
The solution seems to be to add multiple @font-face rules, for example: @font-face { font-family: “DejaVu Sans”; src: url(“fonts/DejaVuSans.ttf”); } @font-face { font-family: “DejaVu Sans”; src: url(“fonts/DejaVuSans-Bold.ttf”); font-weight: bold; } @font-face { font-family: “DejaVu Sans”; src: url(“fonts/DejaVuSans-Oblique.ttf”); font-style: italic, oblique; } @font-face { font-family: “DejaVu Sans”; src: url(“fonts/DejaVuSans-BoldOblique.ttf”); font-weight: bold; font-style: italic, oblique; } By … Read more
This answer has been updated for Swift 4.2. Quick Reference The general form for making and setting an attributed string is like this. You can find other common options below. // create attributed string let myString = “Swift Attributed String” let myAttribute = [ NSAttributedString.Key.foregroundColor: UIColor.blue ] let myAttrString = NSAttributedString(string: myString, attributes: myAttribute) // … Read more