commit cd31b2005fde2440d4277709a0c6efb114718822
parent f28ba51069614bc481cc7e396fd12961e16c40f3
Author: lumidify <nobody@lumidify.org>
Date: Sun, 10 May 2020 20:47:46 +0200
Remove cruft
Diffstat:
M | textedit_wip.c | | | 61 | ------------------------------------------------------------- |
1 file changed, 0 insertions(+), 61 deletions(-)
diff --git a/textedit_wip.c b/textedit_wip.c
@@ -48,67 +48,6 @@ LTK_ARRAY_INIT_IMPL(char_type, FriBidiCharType)
LTK_ARRAY_INIT_IMPL(level, FriBidiLevel)
LTK_STACK_INIT_IMPL(script, int, hb_script_t, pair_index, script);
- int is_hor = HB_DIRECTION_IS_HORIZONTAL(ts->dir);
- tl->y_max = tl->x_max = INT_MIN;
- tl->y_min = tl->x_min = INT_MAX;
- tl->w = tl->h = 0;
- while (ts) {
- if (HB_DIRECTION_IS_HORIZONTAL(ts->dir) != is_hor) {
- (void)fprintf(stderr, "WARNING: mixed horizontal/vertical text is not supported; ignoring\n");
- continue;
- }
- if (is_hor) {
- if (tl->y_max < ts->y_max) {
- tl->y_max = ts->y_max;
- }
- if (tl->y_min > ts->y_min) {
- tl->y_min = ts->y_min;
- }
- tl->w += ts->w;
- } else {
- if (tl->x_max < ts->x_max) {
- tl->x_max = ts->x_max;
- }
- if (tl->x_min > ts->x_min) {
- tl->x_min = ts->x_min;
- }
- tl->h += ts->h;
- }
- ts = ts->next;
- }
- if (is_hor) {
- tl->h = tl->y_max - tl->y_min;
- } else {
- tl->w = tl->x_max - tl->x_min;
- }
-
- return tl;
-}
-
-void
-ltk_destroy_text_segment(LtkTextSegment *ts)
-{
- LtkGlyph *glyph, *next_glyph;
- khash_t(glyphinfo) *gcache;
- LtkFont *font;
- int k;
- glyph = ts->start_glyph;
- k = kh_get(glyphinfo, ltk_global->tm->glyph_cache, ts->font_id << 16 + ts->font_size);
- gcache = kh_value(ltk_global->tm->glyph_cache, k);
- do {
- next_glyph = glyph->next;
- ltk_destroy_glyph(glyph, gcache);
- } while (glyph = next_glyph);
- k = kh_get(fontstruct, ltk_global->tm->font_cache, ts->font_id);
- font = kh_value(ltk_global->tm->font_cache, k);
- if (--font->refs < 1) {
- kh_del(fontstruct, ltk_global->tm->font_cache, k);
- ltk_destroy_font(font);
- }
- free(ts->str);
- free(ts);
-}
-
/* based on http://codemadness.org/git/dwm-font/file/drw.c.html#l315 */
XImage *
ltk_render_text_line(