Gujarati Font Rendering

Why is the Gujarati-Indian text not rendered correctly using Arial Unicode MS?

Neither iText5 nor iText2 (which is a very outdated version by the way) support rendering of Indic scripts, no matter which font you select.

Rendering Indic scripts is not similar to any Latin scripts, because a long series of additional actions should be taken to get the correct result, e.g. some characters need to be reordered first according to the language rules.

This is a known issue to iText company.

There is a stub implementation for Gujaranti in iText5 called GujaratiLigaturizer, but the implementation is really poor and you cannot expect to get correct results with it.

You can try to process your string with this ligaturizer and then output the resultant string in the following way:

IndicLigaturizer g = new GujaratiLigaturizer();
String processed = g.process(inputString);
// proceed with the processed string

Indic languages on Android browser/GUI (Gujarati) improper rendering

Rendering Gujarati (and other "complex" scripts, i.e. those which use half-forms, contextual forms, rearrangement, etc.) requires more than just fonts; it also needs text layout. Text layout capability is normally supplied by the host operating system or in some cases the application. Android has been improving text layout support, but even the latest version is still not complete for all scripts. In other words: you cannot easily fix this with fonts alone, even for recent versions of Android.

Possible workarounds:

  • develop some kind of plugin or extension that does correct Gujarati layout and require users to download/install the plugin to use your site. This will likely be a very high-impedance path, requiring a great deal of expertise in fonts, software development, and knowledge of the target writing system. Not to mention the inconvenience for your users.

  • develop a custom version of a Gujarati font and use corresponding custom text in your site that does not require text layout; supply the font via @font-face (webfont). This will also likely be fairly challenging if you do not have experience with font development, but would probably be the best path.

  • render the text to images; do browser-sniffing and supply images for cases where the client is known not to support complex scripts. This is likely to fail much of the time (hard to keep track of browser capabilities, not to mention the problem of reliably detecting browsers to begin with). But guaranteed to give the right results.

Custom Gujarati font (GopikaTwo) is not supported on Android mobile browser and hybrid application

This worked.


@font-face {
font-family: 'GopikaTwo';
src: url('../assets/fonts/GopikaTwo.eot?#iefix') format('embedded-opentype'), url('../assets/fonts/GopikaTwo.woff') format('woff'), url('../assets/fonts/GopikaTwo.ttf') format('truetype'), url('../assets/fonts/GopikaTwo.svg#GopikaTwo') format('svg');
font-weight: normal;
font-style: normal;
$font-family-base: "GopikaTwo";
$font-family-ios-base: $font-family-base;
$font-family-md-base: $font-family-base;
$font-family-wp-base: $font-family-base;

gujarati fonts not display properly from mysql database

Add this on top of your PHP code !

header('Content-Type: text/html;charset=utf-8');

In your code like..

header('Content-Type: text/html;charset=utf-8'); //<=---- Add here

$query = MySQL_query($con,"SELECT * FROM guj1") or die(mysqli_error());
echo utf8_decode($row['about']);


Related Topics

Leave a reply