Commit graph

10 commits

Author SHA1 Message Date
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
Simon Hausmann
570e51eaa9 Improve API of color handling of text
Make the text color a rendering variable, so that it can be passed
through as uniform to the glyph shader and applied to the gray
map of the glyphs. This avoids re-creating the glyph runs when
merely the color changes.

This already "worked" for the glyph cache based text rendering,
but it wasn't used because of the wasm canvas code path. This
patch changes that to render the text into a text using simply black
and then render that texture using our existing glyph shader,
which merely uses the alpha channel anyway.

This reduces also #cfg's.
2020-09-02 11:48:41 +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
Olivier Goffart
1d0eacc87f Fix wasm build 2020-08-04 12:22:40 +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
4d645dd9a3 Remove fake string_to_glyphs implementation for canvas text
We don't need it
2020-07-28 09:39:31 +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