iink SDK on Device

Answered

How to change font in the Text Document's recognized text line

Hello,

I'm using Android and had a question of how I can change the font on the Text Document's recognized text line. The one above, next to the caret-block looking character.


image



I tried the following, but it seems to have no effect:

editor.setTheme("glyph.text { font-family:serif; }");


Thanks,
Andrey


Best Answer

Dear Rev,


sorry for the mis understanding.


Basically, you would like to update the style of the preview window?


This cannot be done setting the style sheet, as the style sheet applies to the editor, while the preview window is managed by the Smart Guide View.


You can refer to the SmartGuideView.java file in the uireferenceimplementation to set your own style sheet, but this will be demanding.


Best regards,


Olivier




Dear Andrey,


Thank you for your question.


Based on your screenshot, it seems you are using the Chinese language?


In that case, only the Noto font is supported (for Chinese, Japanese, Korean and Armenian).


Best regards,


Olivier

Dear Olivier,

Sorry for a low quality photo—I was using my laptop's built in camera. The text is in English, and the scribble (which amazingly gets recognized with your library) is "The". I'd like to change the recognized text font.

Thanks,
Andrey

Answer

Dear Rev,


sorry for the mis understanding.


Basically, you would like to update the style of the preview window?


This cannot be done setting the style sheet, as the style sheet applies to the editor, while the preview window is managed by the Smart Guide View.


You can refer to the SmartGuideView.java file in the uireferenceimplementation to set your own style sheet, but this will be demanding.


Best regards,


Olivier



Hello Olivier,

I looked in SmartGuideView.java and attempted to change the font family by using this script onAttachedToWindow(), but it seems to have no effect:

TextView wordView = findViewById(R.id.word_view);
Typeface face = Typeface.createFromAsset(getContext().getAssets(), "fonts-myscript/ArchitectsDaughter.ttf");
wordView.setTypeface(face);

I'm able to change the font size in editor_view.xml, in the android:id="@+id/word_view", but font-family flags seem to have no effect on this (even the standard font types).

Can you point me in the right direction? I don't need anything fancy, just a different font and I can already change the size.

Thanks,
Andrey