Commit graph

13 commits

Author SHA1 Message Date
Simon Hausmann
fe079c644e Simplify byte offset vs. char index handling in the font code
Use char_indices() already for string_to_glyphs.
2020-09-22 18:47:15 +02:00
Simon Hausmann
49edd69a3a Fix multi-byte handling hit testing
Return a byte offset within the string for the hit test in TextInput.
2020-09-22 18:43:00 +02:00
Simon Hausmann
722fce61f2 Add support for selecting text with the mouse to TextInput 2020-09-22 15:37:54 +02:00
Simon Hausmann
37e550e540 Fix inconsistency in Font API
Have just one height() function in the fontkit and canvas version.
2020-09-15 12:28:30 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
f86f8360b2 Fix rendering of text with spaces
Don't waste glyphs and potential pixels from the rasterizer for space --
merely use the advance.
2020-08-07 15:32:59 +02:00
Simon Hausmann
71a1daaf5a Don't crash if we can't find the unicode replacement character
Fall back to a question mark :-)
2020-08-04 14:28:45 +02:00
Olivier Goffart
2d04e47230 Remove stray dbg 2020-08-04 12:59:49 +02:00
Olivier Goffart
01a626cf49 Fix panic when the glyph do not exist in the font
This happen with emoji.
Show a replacement character (�) instead
2020-08-04 12:18:30 +02:00
Simon Hausmann
c102fca828 Move the glyph rasterization code into the new font module in corelib 2020-07-28 14:22:34 +02:00
Simon Hausmann
c88a4c44ab Minor cleanup in fontkit code
I think I've found the right placement of lifetime specifiers to fix
string_to_glyphs() to return an iterator instead of allocating a vector :-)
2020-07-28 09:32:18 +02:00
Simon Hausmann
8a2ff4fd5f Provide a basic implementation of layout_info for Text
This also starts moving the rendering independent part of the font handling
to corelib. The next step will be to adapt the rendering code to use that
instead of its own.
2020-07-27 21:36:58 +02:00