Add missing association between char & glyph id
This commit is contained in:
parent
d1cf771c14
commit
43a98a1df1
@ -543,6 +543,14 @@ in_symbol_maps(FontGroup *fg, char_type ch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Decides which 'font' to use for a given cell.
|
||||||
|
//
|
||||||
|
// Possible results:
|
||||||
|
// - NO_FONT
|
||||||
|
// - MISSING_FONT
|
||||||
|
// - BLANK_FONT
|
||||||
|
// - BOX_FONT
|
||||||
|
// - an index in the fonts list
|
||||||
static inline ssize_t
|
static inline ssize_t
|
||||||
font_for_cell(FontGroup *fg, CPUCell *cpu_cell, GPUCell *gpu_cell, bool *is_fallback_font, bool *is_emoji_presentation) {
|
font_for_cell(FontGroup *fg, CPUCell *cpu_cell, GPUCell *gpu_cell, bool *is_fallback_font, bool *is_emoji_presentation) {
|
||||||
*is_fallback_font = false;
|
*is_fallback_font = false;
|
||||||
@ -592,22 +600,31 @@ set_sprite(GPUCell *cell, sprite_index x, sprite_index y, sprite_index z) {
|
|||||||
cell->sprite_x = x; cell->sprite_y = y; cell->sprite_z = z;
|
cell->sprite_x = x; cell->sprite_y = y; cell->sprite_z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gives a unique (arbitrary) id to a box glyph
|
||||||
static inline glyph_index
|
static inline glyph_index
|
||||||
box_glyph_id(char_type ch) {
|
box_glyph_id(char_type ch) {
|
||||||
START_ALLOW_CASE_RANGE
|
START_ALLOW_CASE_RANGE
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 0x2500 ... 0x259f:
|
case 0x2500 ... 0x259f:
|
||||||
return ch - 0x2500;
|
return ch - 0x2500;
|
||||||
case 0xe0b0:
|
case 0xe0b0: //
|
||||||
return 0xfa;
|
return 0x0fa;
|
||||||
case 0xe0b2:
|
case 0xe0b2: //
|
||||||
return 0xfb;
|
return 0x0fb;
|
||||||
case 0xe0b4:
|
case 0xe0b4: //
|
||||||
return 0xfc;
|
return 0x0fc;
|
||||||
case 0xe0b6:
|
case 0xe0b6: //
|
||||||
return 0xfd;
|
return 0x0fd;
|
||||||
|
case 0xe0b8: //
|
||||||
|
return 0x0fe;
|
||||||
|
case 0xe0ba: //
|
||||||
|
return 0x0ff;
|
||||||
|
case 0xe0bc: //
|
||||||
|
return 0x100;
|
||||||
|
case 0xe0be: //
|
||||||
|
return 0x101;
|
||||||
default:
|
default:
|
||||||
return 0xff;
|
return 0xfff;
|
||||||
}
|
}
|
||||||
END_ALLOW_CASE_RANGE
|
END_ALLOW_CASE_RANGE
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,11 @@
|
|||||||
# vim:fileencoding=utf-8
|
# vim:fileencoding=utf-8
|
||||||
# License: GPL v3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
|
# License: GPL v3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: to add a new glyph, add an entry to the `box_chars` dict, then update
|
||||||
|
# the functions `font_for_cell` and `box_glyph_id` in `kitty/fonts.c`.
|
||||||
|
#
|
||||||
|
|
||||||
import math
|
import math
|
||||||
from functools import partial as p
|
from functools import partial as p
|
||||||
from itertools import repeat
|
from itertools import repeat
|
||||||
@ -173,7 +178,6 @@ def triangle(buf, width, height, left=True):
|
|||||||
|
|
||||||
|
|
||||||
def corner_triangle(buf, width, height, corner):
|
def corner_triangle(buf, width, height, corner):
|
||||||
print(f"corner_triangle: corner is '{corner}'")
|
|
||||||
if corner == 'top-right' or corner == 'bottom-left':
|
if corner == 'top-right' or corner == 'bottom-left':
|
||||||
diagonal_y = line_equation(0, 0, width - 1, height - 1)
|
diagonal_y = line_equation(0, 0, width - 1, height - 1)
|
||||||
if corner == 'top-right':
|
if corner == 'top-right':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user