- added ifdef INTERNATIONAL for changes in interface.c

- changed switching to smaller/larger fonts, it now does only 1 pnt size.
  with standard font (11), medium is 10, small 9
This commit is contained in:
2003-10-23 22:28:49 +00:00
parent 734637215b
commit 904c039e3c
3 changed files with 26 additions and 24 deletions

View File

@@ -185,8 +185,8 @@ int FTF_TTFont::SetFont(char* str, int size)
fontl = new FTGLPixmapFont(str); fontl = new FTGLPixmapFont(str);
success = fonts->FaceSize(size-2<8?8:size-2); success = fonts->FaceSize(size-2<8?8:size-2);
success = fontm->FaceSize(size); success = fontm->FaceSize(size-1<8?8:size-1);
success = fontl->FaceSize(size+2); success = fontl->FaceSize(size);
if(!success) return 0; if(!success) return 0;
success = fonts->CharMap(ft_encoding_unicode); success = fonts->CharMap(ft_encoding_unicode);
@@ -238,8 +238,8 @@ void FTF_TTFont::SetEncoding(char* str)
void FTF_TTFont::SetSize(int size) void FTF_TTFont::SetSize(int size)
{ {
fonts->FaceSize(size-2<8?8:size-2); fonts->FaceSize(size-2<8?8:size-2);
fontm->FaceSize(size); fontm->FaceSize(size-1<8?8:size-1);
fontl->FaceSize(size+2); fontl->FaceSize(size);
font_size = size; font_size = size;
} }

View File

@@ -466,7 +466,6 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
ui_graphics_to_window(block->win, &block->minx, &block->miny); ui_graphics_to_window(block->win, &block->minx, &block->miny);
ui_graphics_to_window(block->win, &block->maxx, &block->maxy); ui_graphics_to_window(block->win, &block->maxx, &block->maxy);
} }
@@ -598,7 +597,7 @@ void uiDrawBlock(uiBlock *block)
} }
ui_draw_links(block); ui_draw_links(block);
uiPanelPop(block); // matrix restored uiPanelPop(block); // matrix restored
} }
@@ -1695,7 +1694,7 @@ static int ui_do_but_BLOCK(uiBut *but)
but->flag |= UI_SELECT; but->flag |= UI_SELECT;
ui_draw_but(but); ui_draw_but(but);
block= but->block_func(0); block= but->block_func(but->poin);
block->xofs = -2; /* for proper alignment */ block->xofs = -2; /* for proper alignment */
ui_positionblock(block, but); ui_positionblock(block, but);
@@ -2354,6 +2353,24 @@ static int ui_mouse_motion_towards_block(uiBlock *block, uiEvent *uevent)
return 0; return 0;
} }
static void ui_set_ftf_font(uiBlock *block)
{
#ifdef INTERNATIONAL
if(block->aspect<1.15) {
FTF_SetFontSize('l');
}
else if(block->aspect<1.59) {
FTF_SetFontSize('m');
}
else {
FTF_SetFontSize('s');
}
#endif
}
/* return: /* return:
* UI_NOTHING pass event to other ui's * UI_NOTHING pass event to other ui's
* UI_CONT don't pass event to other ui's * UI_CONT don't pass event to other ui's
@@ -3055,21 +3072,6 @@ static void ui_set_but_val(uiBut *but, double value)
} }
static void ui_set_ftf_font(uiBlock *block)
{
if(block->aspect<1.05) {
FTF_SetFontSize('l');
}
else if(block->aspect<1.59) {
FTF_SetFontSize('m');
}
else {
FTF_SetFontSize('s');
}
}
void uiSetCurFont(uiBlock *block, int index) void uiSetCurFont(uiBlock *block, int index)
{ {
@@ -3765,7 +3767,7 @@ short pupmenu(char *instr)
short a, startx, starty, endx, endy, boxh=TBOXH, x1, y1; short a, startx, starty, endx, endy, boxh=TBOXH, x1, y1;
static char laststring[UI_MAX_NAME_STR]; static char laststring[UI_MAX_NAME_STR];
MenuData *md; MenuData *md;
/* block stuff first, need to know the font */ /* block stuff first, need to know the font */
block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); block= uiNewBlock(&listb, "menu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT); uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT);

View File

@@ -212,7 +212,7 @@ void start_interface_font(void) {
} }
} else { } else {
U.language= 0; U.language= 0;
U.fontsize= 10; U.fontsize= 11;
U.encoding= 0; U.encoding= 0;
#if defined (__APPLE__) #if defined (__APPLE__)