|
|
|
@ -132,6 +132,67 @@ shim_lower_right_quad(struct consolefontdesc* cfd, unsigned idx){
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
shim_no_upper_left_quad(struct consolefontdesc* cfd, unsigned idx){
|
|
|
|
|
unsigned char* glyph = get_glyph(cfd, idx);
|
|
|
|
|
if(glyph == NULL){
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
for(unsigned r = 0 ; r < cfd->charheight / 2 ; ++r, ++glyph){
|
|
|
|
|
*glyph = 0x0f;
|
|
|
|
|
}
|
|
|
|
|
for(unsigned r = cfd->charheight / 2 ; r < cfd->charheight ; ++r, ++glyph){
|
|
|
|
|
*glyph = 0xff;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
shim_no_upper_right_quad(struct consolefontdesc* cfd, unsigned idx){
|
|
|
|
|
unsigned char* glyph = get_glyph(cfd, idx);
|
|
|
|
|
if(glyph == NULL){
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
for(unsigned r = 0 ; r < cfd->charheight / 2 ; ++r, ++glyph){
|
|
|
|
|
*glyph = 0xf0;
|
|
|
|
|
}
|
|
|
|
|
for(unsigned r = cfd->charheight / 2 ; r < cfd->charheight ; ++r, ++glyph){
|
|
|
|
|
*glyph = 0xff;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
shim_no_lower_left_quad(struct consolefontdesc* cfd, unsigned idx){
|
|
|
|
|
unsigned char* glyph = get_glyph(cfd, idx);
|
|
|
|
|
if(glyph == NULL){
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
for(unsigned r = 0 ; r < cfd->charheight / 2 ; ++r, ++glyph){
|
|
|
|
|
*glyph = 0xff;
|
|
|
|
|
}
|
|
|
|
|
for(unsigned r = cfd->charheight / 2 ; r < cfd->charheight ; ++r, ++glyph){
|
|
|
|
|
*glyph = 0x0f;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
shim_no_lower_right_quad(struct consolefontdesc* cfd, unsigned idx){
|
|
|
|
|
unsigned char* glyph = get_glyph(cfd, idx);
|
|
|
|
|
if(glyph == NULL){
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
for(unsigned r = 0 ; r < cfd->charheight / 2 ; ++r, ++glyph){
|
|
|
|
|
*glyph = 0xff;
|
|
|
|
|
}
|
|
|
|
|
for(unsigned r = cfd->charheight / 2 ; r < cfd->charheight ; ++r, ++glyph){
|
|
|
|
|
*glyph = 0xf0;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// P
|
|
|
|
|
// add UCS2 codepoint |w| to |map| for font idx |fidx|
|
|
|
|
|
static int
|
|
|
|
|
add_to_map(const notcurses* nc, struct unimapdesc* map, wchar_t w, unsigned fidx){
|
|
|
|
@ -241,6 +302,10 @@ program_block_drawing_chars(const notcurses* nc, struct consolefontdesc* cfd,
|
|
|
|
|
{ .glyphfxn = shim_upper_right_quad, .w = L'▝', .found = false, },
|
|
|
|
|
{ .glyphfxn = shim_lower_left_quad, .w = L'▖', .found = false, },
|
|
|
|
|
{ .glyphfxn = shim_lower_right_quad, .w = L'▗', .found = false, },
|
|
|
|
|
{ .glyphfxn = shim_no_upper_left_quad, .w = L'▟', .found = false, },
|
|
|
|
|
{ .glyphfxn = shim_no_upper_right_quad, .w = L'▙', .found = false, },
|
|
|
|
|
{ .glyphfxn = shim_no_lower_left_quad, .w = L'▜', .found = false, },
|
|
|
|
|
{ .glyphfxn = shim_no_lower_right_quad, .w = L'▛', .found = false, },
|
|
|
|
|
};
|
|
|
|
|
// first, take a pass to see which glyphs we already have
|
|
|
|
|
for(unsigned i = 0 ; i < cfd->charcount ; ++i){
|
|
|
|
|