Peter Wunder
abc2801ff1
text: Add MeasureString method ( #1152 )
...
(sorta-kinda continuation from #1151 )
This PR adds a MeasureString(string, font.Face) method next to the Draw() method in Ebiten's
text package. It should work with any supported font.Face, even "non-standard" faces like
those produced by packages like https://github.com/AndreKR/multiface . MeasureString's code
was adapted from the Draw method, so it's just as reliable.
2020-05-13 18:03:39 +09:00
Hajime Hoshi
47d5c3b5e1
Add testing package
2020-04-01 18:10:48 +09:00
Zachary Burkett
bb60818e8d
Add linebreak support to text.Draw ( #1075 )
...
Closes #1074
2020-02-12 23:15:57 +09:00
Hajime Hoshi
4a9a7f936d
Make go vet a little happier on macOS
...
Updates #889
2019-07-22 20:16:22 +09:00
Hajime Hoshi
710f56531f
graphics: Experimental: (*image.Image).SubImage
...
Fixes #722
2018-10-28 02:19:14 +09:00
Hajime Hoshi
fe4f12fa6f
text: Fix style
2018-08-27 23:42:17 +09:00
Hajime Hoshi
1c088dc8b6
text: Use bitmapfont package for testing
2018-08-19 20:16:57 +09:00
Hajime Hoshi
d752408da3
Fix comments not to use the term 'this function'
2018-07-15 01:04:46 +09:00
Hajime Hoshi
92631e64ed
Remove internal/sync
...
nosync package for GopherJS is problematic since nosync's mutex
assumes that Lock call is never duplicated, which is not true in
actual applications.
See also #603 .
2018-05-09 23:41:08 +09:00
Hajime Hoshi
81dfc13b21
text: Remove duplicated glyphs
2018-04-28 22:50:45 +09:00
Hajime Hoshi
be3d529767
text: Bug fix: one image should be used for multiple glyphs ( #535 )
2018-04-26 02:41:01 +09:00
Hajime Hoshi
6caebc2310
text: Avoid creating 0-sized image
2018-04-26 02:11:45 +09:00
Hajime Hoshi
059bab0b13
text: Optimization: reduce ColorM calc
2018-04-23 22:42:38 +09:00
Hajime Hoshi
5257e6f9a7
text: Unify draw calls for multiple runes ( #535 )
2018-04-23 22:15:45 +09:00
Hajime Hoshi
9902497e3d
test: Use flock to make tests exclusive
...
Fixes #575
2018-04-07 00:59:52 +09:00
Hajime Hoshi
9092ec083d
text: Remove uniqFace for performance
...
Fixes #554 . Add comments for #498 .
2018-03-15 23:00:23 +09:00
Hajime Hoshi
c581219bb5
text: Utilize shared textures
...
Fixes #529
2018-03-04 02:38:48 +09:00
Hajime Hoshi
3736fd3cfc
text: Add text_test.go
2018-02-24 04:55:15 +09:00
Hajime Hoshi
c79b795e84
text: Cache GlyphAdvance result
2018-02-18 21:38:48 +09:00
Hajime Hoshi
31ae457a8c
text: Refactoring
2018-02-12 22:24:25 +09:00
Hajime Hoshi
57dd7db893
text: Use uint32 for map keys instead of color.Color interface
2018-02-12 19:32:21 +09:00
Hajime Hoshi
c4f02ac07c
text: Limit color matrices cache size
2018-02-12 04:07:59 +09:00
Hajime Hoshi
12cef4d27e
text: Cache color matrices for performance
2018-02-12 03:33:11 +09:00
Hajime Hoshi
9118772fd1
text: Optimization for browsers
2018-02-12 02:57:51 +09:00
Hajime Hoshi
950219f5b6
text: Remove font struct
2018-02-12 00:57:01 +09:00
Hajime Hoshi
8c1a8b64eb
text: Avoid copying structs for browsers
2018-02-12 00:42:35 +09:00
Hajime Hoshi
da51377cc5
text: Optimize speed: Don't use a struct for map keys
...
Especially for browsers
2018-02-12 00:25:21 +09:00
Hajime Hoshi
a5f9382878
text: Refactoring
2018-02-11 16:17:59 +09:00
Hajime Hoshi
05671e784b
text: Reuse font.Face instances if they are DeepEqual-ly same ( #498 )
2018-02-11 16:05:31 +09:00
Hajime Hoshi
103cd63b32
text: Now package text is stable
2018-02-04 17:49:32 +09:00
Hajime Hoshi
3cf5ca4df3
doc: Improve comments
2017-10-08 03:14:33 +09:00
Hajime Hoshi
d1333e92a5
doc: Improve comments
2017-10-01 20:48:28 +09:00
Hajime Hoshi
631264fce1
Add 'internal/math' package
2017-08-06 20:05:14 +09:00
Hajime Hoshi
064b359c78
text: Bug fix: space was not used correctly
2017-07-21 00:44:37 +09:00
Hajime Hoshi
b58d8bb996
text: Swap arguments face and text
2017-07-20 02:20:15 +09:00
Hajime Hoshi
94c4a76dcf
text: Refactoring: create glyph object in appendGlyph
2017-07-19 02:57:49 +09:00
Hajime Hoshi
28934c4fd2
text: Refactoring: Rename atlas.size -> atlas.glyphSize
2017-07-19 02:52:38 +09:00
Hajime Hoshi
842c535c01
text: Refactoring: Remove some members from atlas
2017-07-19 02:50:55 +09:00
Hajime Hoshi
fd57753089
text: Refactoring: Reduce a global variable
2017-07-18 10:49:12 +09:00
Hajime Hoshi
86296ea89b
text: Refactoring
2017-07-18 02:16:39 +09:00
Hajime Hoshi
9efc794547
text: Don't use Ceil as much as possible for accuracy
2017-07-17 17:00:51 +09:00
Hajime Hoshi
198ffa9ef8
text: doc
2017-07-17 16:17:01 +09:00
Hajime Hoshi
20a43a88e8
text: Remove 'lineHeight' argument
2017-07-17 06:42:48 +09:00
Hajime Hoshi
e0d0f477dc
text: Fix comment
2017-07-17 06:39:06 +09:00
Hajime Hoshi
f64ac89d56
text: doc
2017-07-17 02:15:00 +09:00
Hajime Hoshi
b42f417e3b
text: Update doc
2017-07-17 02:13:30 +09:00
Hajime Hoshi
9908fe0d31
text: Refactoring
2017-07-17 01:54:30 +09:00
Hajime Hoshi
1e84e21857
Add 'text' package ( #363 )
2017-07-17 01:54:24 +09:00