… | |
… | |
144 | } |
144 | } |
145 | |
145 | |
146 | static void |
146 | static void |
147 | layout_get_pixel_size (CFPlus__Layout self, int *w, int *h) |
147 | layout_get_pixel_size (CFPlus__Layout self, int *w, int *h) |
148 | { |
148 | { |
|
|
149 | PangoRectangle rect; |
|
|
150 | |
|
|
151 | // get_pixel_* wrongly rounds down |
149 | pango_layout_get_pixel_size (self->pl, w, h); |
152 | pango_layout_get_extents (self->pl, 0, &rect); |
150 | |
153 | |
151 | if (!*w) *w = 1; |
154 | rect.width = (rect.width + PANGO_SCALE - 1) / PANGO_SCALE; |
152 | if (!*h) *h = 1; |
155 | rect.height = (rect.height + PANGO_SCALE - 1) / PANGO_SCALE; |
153 | |
156 | |
154 | *w = (*w + 3) & ~3; |
157 | if (!rect.width) rect.width = 1; |
|
|
158 | if (!rect.height) rect.height = 1; |
|
|
159 | |
|
|
160 | *w = rect.width; |
|
|
161 | *h = rect.height; |
155 | } |
162 | } |
156 | |
163 | |
157 | typedef uint16_t mapface; |
164 | typedef uint16_t mapface; |
158 | |
165 | |
159 | typedef struct { |
166 | typedef struct { |