Commit graph

125 commits

Author SHA1 Message Date
foamyguy
28b3879f5b fallback for builtin font 2021-01-07 18:21:25 -06:00
Jeff Epler
eaeed21773 label: Use new, optional 'ascent', 'descent' properties
Each time new glyphs have to be loaded from a font, it can take a long
time (hundreds of milliseconds).  In a parallel commit, 'ascent' and
'descent' properties will be added to BDF font objects, are essentially
free to compute, and are in any case much quicker than entering
load_glyphs.

This may change the layout of text slightly.  For instance, the height
of the "M" glyph in GothamBlack-50.bdf is 35, but the Ascent of the font
is 40 (and some characters, such as Å, are taller than the ascent at 45
pixels high)
2020-12-28 09:26:00 -06:00
Kevin Matocha
f23910cdce Breakout blit function, improve handling of builtin builtin bitmap.blit, add back kwargs passing to self Group instance 2020-08-28 15:34:01 -05:00
Kevin Matocha
5d299cc0e8 ran black and pylint 2020-08-28 10:13:52 -05:00
Kevin Matocha
9ef676ef6d Fix scale bug in label.py, remove kwargs from both and add scale input parameter 2020-08-28 10:12:09 -05:00
Kevin Matocha
61dac4d83d rename error variable name for pylint 2020-08-21 22:22:36 -05:00
Kevin Matocha
3f9ea73480 Add raise from for exception handling 2020-08-21 22:19:32 -05:00
Kevin Matocha
cf6d7130d0 Delete redundant + sign 2020-08-21 21:33:47 -05:00
Kevin Matocha
ec28d2a8ec Update header docs to previous release 2020-08-20 12:59:59 -05:00
Kevin Matocha
704744f417 remove whitespace 2020-08-20 12:53:29 -05:00
Kevin Matocha
1421c5d57e Update docs to try to solve unexpected-indentation 2020-08-20 12:10:21 -05:00
Kevin Matocha
7d70ca7a7f Update spacing in doc string 2020-08-20 12:05:35 -05:00
Kevin Matocha
f37e66c2d3 Fix bugs with anchored_position and scaling 2020-08-20 11:37:11 -05:00
Kevin Matocha
6862809305 all: Correct left-hand bounding box position, that was problematic for slanted fonts 2020-08-18 11:59:35 -05:00
Kevin Matocha
c30285993a all: Correct right-side of bounding box for slanted fonts; correct y_offset by deleting impact of newlines, bitmap_label: fix anchored_position rounding error, add speedup with load_glyphs 2020-08-18 11:25:08 -05:00
Kevin Matocha
62de33b401 run black 2020-08-17 12:38:33 -05:00
Kevin Matocha
11f7fe8b11 Include load_glyphs of full text string prior to character-processing loop in _update_text 2020-08-17 11:44:33 -05:00
Margaret Matocha
b66efa1323 Deleted else and corrected tabbing 2020-08-10 18:32:47 -05:00
Margaret Matocha
e89c457f19 Changed pass to return per requested change 2020-08-10 18:23:01 -05:00
Margaret Matocha
4cfc2a4675 ran black 2020-08-08 10:15:38 -05:00
Margaret Matocha
3c9e414c8a Updated label.py to correct position of initial blank text 2020-08-08 09:56:14 -05:00
Scott Shawcroft
ab0158d623
Merge pull request #74 from FoamyGuy/no_bitmap_when_background_none
dont create a background bitmap if background_color is None
2020-07-24 12:38:27 -07:00
Margaret Matocha
9fa93fe67d added disable=too-many-locals to pylint 2020-07-23 15:11:18 -05:00
FoamyGuy
1649a68d60 fix background color check for black color 0 2020-07-23 12:24:12 -05:00
FoamyGuy
bc70c46818 dont create a background bitmap if background_color is None 2020-07-22 20:15:44 -05:00
Margaret Matocha
9b0fe91a6a Added anchor_point and anchor_position options as parameters 2020-07-21 17:08:52 -05:00
Margaret Matocha
85c9a7f4f6 corrected index replacement of tileGrid, and deletion of unused tileGrids 2020-07-12 15:49:46 -05:00
Margaret Matocha
bbc0ea9a68 Updated to regenerate all character tileGrids upon text change 2020-07-09 10:28:51 -05:00
Margaret Matocha
b3114027f3 Check for zero width/height glyphs 2020-07-08 22:23:33 -05:00
kmatch98
b6ec018298
Merge branch 'bitmap_zero' into bitmap_zeroV2 2020-07-07 20:05:17 -05:00
Margaret Matocha
05affa4097 ran black 2020-07-07 19:56:14 -05:00
Margaret Matocha
f106d483a1 Fixed bounding box size calculations and logical flow for updating bitmap in _update_background_color 2020-07-07 19:54:51 -05:00
FoamyGuy
c5af1119d9 remove background tilegrid if text is set to empty and no padding. Fix for Group insert/append issue 2020-07-07 17:20:07 -05:00
FoamyGuy
aa4d0a0036 check if the background tilegrid was added before removing it 2020-07-07 17:01:16 -05:00
FoamyGuy
2063412f78 remove the background tilegrid when not in use. Don't add background tilegrid inside init 2020-07-06 20:50:27 -05:00
FoamyGuy
fdd5bd8894 black format 2020-07-04 10:32:13 -05:00
FoamyGuy
51e13b2e61 fix issue with background being shifted from text. only create bitmap if it will get used. 2020-07-04 10:30:57 -05:00
Margaret Matocha
2d65dc0f5c Reverted a half-updated function for background bitmap management 2020-07-02 22:03:08 -05:00
Margaret Matocha
631d0447b3 Ran black, deleted printdebug statements 2020-07-02 21:51:10 -05:00
Margaret Matocha
062b1bc747 Fixed off-by-one error by int() truncation 2020-07-02 21:49:42 -05:00
Margaret Matocha
0b524cfe2b Updated anchored_position getter/setter 2020-07-02 19:35:50 -05:00
Margaret Matocha
11b6fcbbe2 ran black 2020-07-02 15:12:46 -05:00
Margaret Matocha
c9309dae6a Updated anchored position getter/setter 2020-07-02 15:11:18 -05:00
Margaret Matocha
2caeb592cc Updated initial instancing of Bitmap to non-zero size 2020-07-02 14:00:04 -05:00
FoamyGuy
d020baba0f fix for anchored_position to work correctly with scaled label 2020-06-28 11:01:28 -05:00
FoamyGuy
5fe2117df3 fix max_glyphs count when text wasn't passed in constructor 2020-06-27 09:20:02 -05:00
Melissa LeBlanc-Williams
8661ce1f35 disabled pylint mystery message 2020-06-23 17:36:22 -07:00
caternuson
d9f759eb43 add glyph check 2020-06-18 10:19:25 -07:00
Jeff Epler
1f2bf53313
Merge pull request #49 from kmatch98/background
Updated background color handling for label
2020-06-06 07:08:35 -05:00
Margaret Matocha
05bd0ad842 deleted unnecessary comment 2020-06-05 23:18:18 -05:00