How to set your own font weight?

as the subject implies, I would like to programmatically change / set the font font for an arbitrary font.

Edit: I mean the font for drawing strings in general.

Thanks for any info.

+3
source share
1 answer

As far as I know, you cannot change this as soon as you download the font. You can create a new Typeface from an existing font, for example:

Typeface typeface = Typeface.createFromAsset(getAssets(), "myfontfamily.otf");
Typeface boldTypeface = Typeface.create(typeface, Typeface.BOLD);

, , . (?) , , Bitstream Vera Sans Vera.ttf, VeraBd.ttf, VeraIt.ttf, VeraBI.ttf, /. Typeface , .

EDIT: , , , . - (, Photoshop Office ), TextPaint FAKE_BOLD_TEXT_FLAG, . , . , , , , .:)

, , , .

+8

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


All Articles