These are analogous to the image.Point and image.Rectangle methods in
the standard library.
Change-Id: If8997421a9aeb31d29cfe5eefb79cc481a39df82
Reviewed-on: https://go-review.googlesource.com/34753
Reviewed-by: David Crawshaw <crawshaw@golang.org>
The bounding box of a string does not necessarily contain the origin.
Prior to this commit, BoundString(etc, "x") would call grow exactly
once, with the first argument being the (empty) zero rectangle.
Change-Id: Id7d4f6c250ac0749f6dae19d11f4e97f9c6f45bc
Reviewed-on: https://go-review.googlesource.com/34674
Reviewed-by: Dave Day <djd@golang.org>
It can be useful to measure some text without having to set up a Drawer.
Change-Id: I18b7b1fecc32ca69b7644d598ed21462e7c41edd
Reviewed-on: https://go-review.googlesource.com/21785
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Also add canonical import paths for the newly merged packages.
Change-Id: I96fe3a964ba08e718fc9163c980ef7ea9da551fe
Reviewed-on: https://go-review.googlesource.com/14148
Reviewed-by: David Symonds <dsymonds@golang.org>
This is consistent with Face.GlyphBounds and Face.GlyphAdvance.
Change-Id: I9da6b4f2fdb8f093fc9567c717e8fbbecc624e30
Reviewed-on: https://go-review.googlesource.com/14090
Reviewed-by: David Symonds <dsymonds@golang.org>
These will be used by other vector font packages, such as the truetype
package, to select specific faces.
Change-Id: I3db8c97335089c2076811e8f85d9a8868fc900bd
Reviewed-on: https://go-review.googlesource.com/13714
Reviewed-by: Rob Pike <r@golang.org>
Also delete font.MultiFace. We can resurrect a font.MultiFace type if we
need it in the future, but for now, it's simpler if it lives in the
plan9font package.
Change-Id: I1493b47696c323424e7d91cb7fac15505bfdd023
Reviewed-on: https://go-review.googlesource.com/13520
Reviewed-by: Rob Pike <r@golang.org>
Package font defines an interface for font faces.
Other packages provide font face implementations. For example, a
truetype package (not part of this CL) would provide one based on .ttf
font files.
This CL also introduces the golang.org/x/exp/shiny/font/plan9font
package, a concrete implementation of the font.Face interface for the
Plan 9 bitmap font format.
Change-Id: Iead8914caaa58c7562b18a86b45002ae47486903
Reviewed-on: https://go-review.googlesource.com/13463
Reviewed-by: Rob Pike <r@golang.org>