Home > Mobile >  Freetype set font when the italicized word spacing
Freetype set font when the italicized word spacing

Time:09-25

Problems such as the title described above, when set in italics, the gap between the two characters become big
When the normal

When set to italics

The following is the implementation code



For a little long, still can't solve, hope which can help to have a look at the great god, please, thank you!

CodePudding user response:

Used FreeType forgive me pretty good, but for performance, and single chip microcomputer of character that is the same, A text is A separate images, and the image in the computer is actually horizontal flat vertical is in the shape of the Rect tilted so even if you look at the text, it's only pixel point conversion coordinates and draw the canvas or A rectangle, so even if you look at the spacing is 0, also feel that draw text spacing each are not equal, this Ctrl Alt A screenshot you just know, sloping word or A rectangle,

How to make the gap is equal? The simplest is to italic canvas is adjusted for the same size,

CodePudding user response:


Also just put your words use QImage with the same size, the size of the biggest words,

CodePudding user response:

refer to the second floor it is a nice nickname response:

Or put your text QImage use the same size, the size of the largest text,


I was the first time contact freetype, project found the problem, also understand what you said is a piece of image splicing,
But hope can realize like word set after the italic aperture size remains the same

CodePudding user response:

Simple ah, let me give you

CodePudding user response:

CodePudding user response:

Calculate the coordinates of a, b, and then the Pythagorean theorem to m, is very easy,

CodePudding user response:

refer to 6th floor this is a nice nickname response:
calculate the coordinates of a, b, and then the Pythagorean theorem to m, is very easy,

This drawing is wrong, so that can be rotation, tilt font, coordinates at the bottom of the basic didn't change, like word

CodePudding user response:

Well, you said is right, this is I use PPT picture, before something casually, italics from rectangle into a parallelogram, then the parallelogram wrapped up with rectangular canvas the rect get finally a word, you can just know how much the mobile, without much trouble
  •  Tags:  
  • Qt
  • Related