This commit is contained in:
kraus 2018-08-03 22:56:56 +02:00
parent d7a20ce5f8
commit 39de6b6bc0
2 changed files with 17 additions and 2 deletions

View File

@ -41,6 +41,10 @@ logisoso: bdfconv
-../otf2bdf/otf2bdf -a -r 72 -p 131 -o tmp.bdf ../ttf/Logisoso.ttf
./bdfconv -v -f 1 -m '32,42-57' tmp.bdf -o u8g2_font_logisoso_tn.c -n u8g2_font_logisoso_tn -d ../bdf/helvB18.bdf
inr: bdfconv
-../otf2bdf/otf2bdf -a -r 72 -p 33 -o tmp.bdf ../ttf/inr.otf
./bdfconv -v -b 2 -f 1 -m '32,42-57' tmp.bdf -o u8g2_font_inr_m.c -n u8g2_font_inr_m -d ../bdf/helvB18.bdf
logisoso92x: bdfconv
-../otf2bdf/otf2bdf -a -r 72 -p 131 -o tmp.bdf ../ttf/Logisoso.ttf
./bdfconv -v -f 1 -m '32,42-57,65-70' tmp.bdf -o u8g2_font_logisoso92_tx.c -n u8g2_font_logisoso92_tx -d ../bdf/helvB18.bdf

View File

@ -348,14 +348,20 @@ int get_signed_bit_size(long v)
return get_unsigned_bit_size(v) + 1;
}
/*
#define BDF_BBX_MODE_MINIMAL 0
#define BDF_BBX_MODE_HEIGHT 1
#define BDF_BBX_MODE_MAX 2
#define BDF_BBX_MODE_M8 3
*/
void bf_copy_bbx_and_update_shift(bf_t *bf, bbx_t *target_bbx, bg_t *bg)
{
/* modifing the following code requires update ind bdf_rle.c also */
if ( bf->bbx_mode == BDF_BBX_MODE_MINIMAL )
if ( bf->bbx_mode == BDF_BBX_MODE_MINIMAL ) // mode 0
{
*target_bbx = bg->bbx;
}
else if ( bf->bbx_mode == BDF_BBX_MODE_MAX )
else if ( bf->bbx_mode == BDF_BBX_MODE_MAX ) // mode 2 (monospace)
{
*target_bbx = bf->max;
target_bbx->x = 0;
@ -748,6 +754,11 @@ bf_t *bf_OpenFromFile(const char *bdf_filename, int is_verbose, int bbx_mode, co
//bf_ShowAllGlyphs(bf, &(bf->max));
bf_CalculateMinMaxDWidth(bf);
/* issue 669 */
if ( bf->bbx_mode == BDF_BBX_MODE_MAX )
if ( bf->max.w < bf->dx_max )
bf->max.w = bf->dx_max;
bf_CalculateMaxBitFieldSize(bf);