A more general cp->gid API
This commit is contained in:
parent
d01e5f72fc
commit
336857a106
@ -248,6 +248,11 @@ set_font_size(PyObject UNUSED *m, PyObject *args) {
|
|||||||
return update_cell_metrics();
|
return update_cell_metrics();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
face_has_codepoint(PyObject* face, char_type cp) {
|
||||||
|
return glyph_id_for_codepoint(face, cp) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool
|
static inline bool
|
||||||
has_cell_text(Font *self, Cell *cell) {
|
has_cell_text(Font *self, Cell *cell) {
|
||||||
if (!face_has_codepoint(self->face, cell->ch)) return false;
|
if (!face_has_codepoint(self->face, cell->ch)) return false;
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool face_has_codepoint(PyObject *, char_type);
|
unsigned int glyph_id_for_codepoint(PyObject *, char_type);
|
||||||
hb_font_t* harfbuzz_font_for_face(PyObject*);
|
hb_font_t* harfbuzz_font_for_face(PyObject*);
|
||||||
bool set_size_for_face(PyObject*, unsigned int, bool);
|
bool set_size_for_face(PyObject*, unsigned int, bool);
|
||||||
void cell_metrics(PyObject*, unsigned int*, unsigned int*, unsigned int*, unsigned int*, unsigned int*);
|
void cell_metrics(PyObject*, unsigned int*, unsigned int*, unsigned int*, unsigned int*, unsigned int*);
|
||||||
|
|||||||
@ -301,9 +301,9 @@ cell_metrics(PyObject *s, unsigned int* cell_width, unsigned int* cell_height, u
|
|||||||
*underline_thickness = MAX(1, font_units_to_pixels(self, self->underline_thickness));
|
*underline_thickness = MAX(1, font_units_to_pixels(self, self->underline_thickness));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
unsigned int
|
||||||
face_has_codepoint(PyObject *s, char_type cp) {
|
glyph_id_for_codepoint(PyObject *s, char_type cp) {
|
||||||
return FT_Get_Char_Index(((Face*)s)->face, cp) > 0;
|
return FT_Get_Char_Index(((Face*)s)->face, cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_font_t*
|
hb_font_t*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user