Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-05-03 10:55:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-03 11:01:20 +0300
commitccaab7268572f1640411309463009b3a3453b247 (patch)
tree300cebf59fa9457b25ad0f3abe9c836363126743 /source/blender/blenfont/intern/blf_internal_types.h
parent5366eb89c6eb4057edfdf16eb42f31d34f6a0ba4 (diff)
BLF: use 'int' for internal glyph x,y bearing
These were stored as float but were originally cast from an int and were often cast back to int. Also use int pairs for dimensions values.
Diffstat (limited to 'source/blender/blenfont/intern/blf_internal_types.h')
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h
index 6fae3eb4376..362cbf6730f 100644
--- a/source/blender/blenfont/intern/blf_internal_types.h
+++ b/source/blender/blenfont/intern/blf_internal_types.h
@@ -119,17 +119,16 @@ typedef struct GlyphBLF {
*/
unsigned char *bitmap;
- /* glyph width and height. */
- int width;
- int height;
+ /* Glyph width and height. */
+ int dims[2];
int pitch;
- /* X and Y bearing of the glyph.
+ /**
+ * X and Y bearing of the glyph.
* The X bearing is from the origin to the glyph left bbox edge.
* The Y bearing is from the baseline to the top of the glyph edge.
*/
- float pos_x;
- float pos_y;
+ int pos[2];
struct GlyphCacheBLF *glyph_cache;
} GlyphBLF;
@@ -141,9 +140,8 @@ typedef struct FontBufInfoBLF {
/* the same but unsigned char */
unsigned char *cbuf;
- /* buffer size, keep signed so comparisons with negative values work */
- int w;
- int h;
+ /** Buffer size, keep signed so comparisons with negative values work. */
+ int dims[2];
/* number of channels. */
int ch;