How can I display Latin words in Android?

后端 未结 2 1961
时光说笑
时光说笑 2020-12-12 07:04

I am a new Android developer. I\'m working with a Latin font in my app but I can\'t get it to work and keep getting a ? for the character. My code is below, usi

相关标签:
2条回答
  • 2020-12-12 07:16

    My guess is that the character in place of “?” in “bon?” is “ō” U+014D LATIN SMALL LETTER O WITH MACRON, because that’s really the only sensible possibility. Latin as such is written using plain A to Z letters only, but the macron is often used above vowels in dictionaries and grammars to indicate that a vowel is pronounced long.

    The character “ō” displays OK on an actual Android device, but your emulator might have a font problem with it (i.e., the font it is using does not contain the character). More probably, there is a character encoding problem. It can hardly be analyzed without further information (e.g., which emulator is used, how the character is represented in HTML, and how the encoding of the HTML document has been declared, and what the actual encoding is).

    0 讨论(0)
  • 2020-12-12 07:32

    I don't know what you have done in code and why used HTML ? but I can assume you need this simple code. please see below modified method.

    private void displayTestQuestion() {
        resetEverything();
        stats.setText(Integer.toString(totalRightQuestions)+"/"+Integer.toString(totalNumberOfQuestions));
    
        String questionText = questionCursor.getString(0);
        Typeface font = Typeface.createFromAsset(getContext().getAssets(), "fonts/LATINWD.TTF");
        question.setTypeface(font);
        question.setText(questionText);
        adjectiveNumber = questionCursor.getString(1);
        adjectiveCase = questionCursor.getString(3);
        adjectiveGender = questionCursor.getString(2);
    }
    
    0 讨论(0)
提交回复
热议问题