Commit Graph

12 Commits

Author SHA1 Message Date
Greg Pomerantz 3dd7c8121c font/opentype: add Collection type and methods
The Collection type wraps sfnt.Collection and allows lazy-loading
of fonts from SFNT collections.

Signed-off-by: Greg Pomerantz <gmp.gio@wow.st>
2019-12-18 19:07:54 +01:00
Elias Naur c9f1f59c40 font/opentype: fix typo
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-16 20:06:33 +01:00
Elias Naur 0768fbe590 text: convert clip.Ops to op.CallOp
MacroOp is about to lose the ability to run a different operation list
than the one it was recorded on. Text shape caches rely on that property,
and must use the new CallOp operation added for purpose.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-12-12 00:45:36 +01:00
Werner Laurensse 4bcb4ec8b6 text: add Metrics method to Face interface. font/opentype: implement Metrics method for Font struct.
Signed-off-by: Werner Laurensse <werner@alman.ax>
2019-11-24 20:01:33 +01:00
Elias Naur f3f079df32 font/opentype: treat invalid characters less specially
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 20:15:31 +01:00
Elias Naur c072a7eb87 font/opentype: fix kerning
Fixes gio#69

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-20 19:57:38 +01:00
Elias Naur 682d2810d3 text: remove SingleLine from LayoutOptions
Low level text layout should not deal with filtering newlines.

Updates gio#61

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-09 20:01:40 +01:00
Elias Naur e864ac3fc3 op/clip: split clip operations into its own package
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-09 19:07:00 +01:00
Elias Naur 143d2aae95 font/gofont: add explicit Register
Registering the font as a side effect of importing the gofont package
was too magic. Require an explicit Register call instead. As a side
effect, it is more clear which font is the default (the first one
registered).

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-23 10:18:11 +02:00
Elias Naur 445d85efe0 font/gofont: add Go font convenience package
To use the Go font in a Gio program, import it:

import _ "gioui.org/font/gofont"

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-13 18:23:30 +02:00
Elias Naur edf0d8ef99 font/opentype,text/opentype: move package
Opentype parsing, layout and shaping will be used by subpackages to package
font. Move the opentype package accordingly.

Remove the Must helper function; programs will no longer use the opentype
package in the normal case.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-13 18:23:30 +02:00
Elias Naur 40822ef26b font: add a central font registry
Package font holds a singleton text.Shaper for general use. Subpackages
call Register to add fonts to the registry.

The intention is that programs can add a typeface by importing a package:

import _ "gioui.org/font/gofont"

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-13 18:23:30 +02:00