Display Languages ​​on Android Browser / GUI (Gujarati)

I have a website specifically for viewing on Android devices, I use Gujarati languages, and I have a big problem displaying Gujarati fonts correctly, at least I want workarounds for getting Gujarati fonts to work correctly, which by default is not Any version of Android is supported. And so I did

Work around: - Phone correction - Finding the correct Unicode font for Gujarati language - Replace the existing DroidSansFallback.ttf in System / fonts with Gujarati font (with some additional changes to fontsfallback.xml in the system / etc folder for ICS)

This helped me understand the Gujarati texts, but not the correct rendering.

Problem:

1) The problem of half-formats, half-form letters are not displayed properly, as they are supposed to combine, but they are not,

If you refer to this faq on unicode.org , it clearly defines how to do this, I also used the specified "Zero Width" Joiner ", using html codes for each letter, using [unicodeLookup] [7], but this does not affect .

In any case, this problem is not primary, since it is wrong, but still not wrong.

2) This rendering problem leads to the fact that texts are not printed correctly. See two images below. The first one is correctly displayed as visible on the PC, and the second is a screenshot from Android’s own browser.

image

the problem marked as 1 is a fist problem, and the second marked as 2 is the second problem, if you google "Devanagari - Unicode Consortium ch09", you will get a pdf link referring to this problem (just goto "Figure 9-8 . Order in Devanagari "), which clearly explains how scripts are displayed correctly. It seems that I have ever used android to render scripts that are not supported for such languages, if there are any changes that can be made to the Android OS to display the fonts in the correct order, please help.

This is definitely not a problem with fonts, since I tried to use the Shruti fonts that are used by Windows, this is a problem with rendering these complex scripts

Possible solutions: (undesirable)

1) Using opera mini with bitmap fonts (not my solution)

2) Use images instead of texts (again, not my decision, since my site will have 300 lines of lists, and for mobile devices, they don’t want to increase the page size)

Please give me the correct solution to this problem, thanks in advance!

+4
source share
2 answers

Rendering Gujarati (and other "complex" scripts, i.e. those that use half-forms, contextual forms, rearrangements, etc.) requires more than just fonts; he also needs a mock text. The ability to compose text is usually provided by the host operating system or, in some cases, applications. Android improves text layout support, but even the latest version is still incomplete for all scripts. In other words: you cannot easily fix this with just fonts, even for the latest versions of Android.

Possible workarounds:

  • create some kind of plugin or extension that fixes the Gujarati layout and requires users to download / install the plugin to use your site. This is likely to be a very high impedance path, requiring a lot of experience in fonts, software development, and knowledge of the target writing system. Not to mention the inconvenience to your users.

  • create a custom version of the Gujarati font and use the appropriate custom text on your site that does not require text layout; put the font through @ font-face (webfont). It will also probably be quite difficult if you have no experience in font development, but will probably be the best way.

  • render text to images; take browser snapshots and deliver images for cases where the client, as you know, does not support complex scripts. This will likely crash a lot of time (it’s hard to track browser capabilities, not to mention the problem of reliable browser detection for starters). But guaranteed to give the correct results.

+2
source

If you want to browse your site on all devices, just put websites on your site. web fonts are embedded fonts that you host on your server, and with the appropriate css link, anyone can view this without installing fonts on devices.

For other websites that do not have web fonts, use firefox for android, and then get addon https://addons.mozilla.org/en-us/android/addon/gujarati-fonts-package . Now you can browse all web pages in Gujarati fonts without any complicated procedure or launch android.

+1
source

Source: https://habr.com/ru/post/1435631/


All Articles