Skip to content

Commit

Permalink
Fix #617 and more font tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
pventafridda committed Mar 5, 2015
1 parent a30b151 commit 8c23455
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
22 changes: 21 additions & 1 deletion Common/Source/Draw/Multimaps/DrawVisualGlide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,15 @@ void MapWindow::DrawVisualGlide(LKSurface& Surface, DiagrammStruct* pDia) {

switch(ScreenSize) {
case ss800x480:
#ifdef __linux__
_tcscpy(tmpT,_T("MMMMMMMM")); // we use no boldness to MapLabel
line1Font=MapLabelFont;
line2Font=CDIWindowFont;
#else
_tcscpy(tmpT,_T("MMMMMMMMM"));
line1Font=MapLabelFont;
line2Font=CDIWindowFont;
#endif
break;
case ss480x272:
case ss320x240:
Expand All @@ -96,11 +102,13 @@ void MapWindow::DrawVisualGlide(LKSurface& Surface, DiagrammStruct* pDia) {
case ss640x480:
#ifdef __linux__
_tcscpy(tmpT,_T("MMMMMMM"));
line1Font=CDIWindowFont;
line2Font=CDIWindowFont;
#else
_tcscpy(tmpT,_T("MMMMMM"));
#endif
line1Font=CDIWindowFont;
line2Font=CDIWindowFont;
#endif
break;

case ss272x480:
Expand All @@ -118,9 +126,21 @@ void MapWindow::DrawVisualGlide(LKSurface& Surface, DiagrammStruct* pDia) {
line2Font=LK8PanelSmallFont;
break;
default:
#ifdef __linux__
if (!ScreenLandscape) {
_tcscpy(tmpT,_T("MMMMMMM"));
line1Font=LK8PanelSmallFont;
line2Font=LK8PanelSmallFont;
} else {
_tcscpy(tmpT,_T("MMMMMMM"));
line1Font=CDIWindowFont;
line2Font=CDIWindowFont;
}
#else
_tcscpy(tmpT,_T("MMMMMMM"));
line1Font=LK8PanelSmallFont;
line2Font=LK8PanelSmallFont;
#endif
break;
}

Expand Down
36 changes: 29 additions & 7 deletions Common/Source/Fonts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,21 @@ void InitialiseFontsHardCoded(RECT rc,
if ( (ScreenSize==(ScreenSize_t)ss480x272) ||
(ScreenSize==0 && ScreenLandscape && ScreenGeometry==SCREEN_GEOMETRY_169) )
{ // WQVGA e.g. MIO
#ifdef __linux__
propGetFontSettingsFromString(TEXT("14,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardTitleWindowLogFont);
propGetFontSettingsFromString(TEXT("15,0,0,0,800,0,0,0,0,0,0,4,2,Tahoma"), ptrhardCDIWindowLogFont);
propGetFontSettingsFromString(TEXT("16,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardMapLabelLogFont);
propGetFontSettingsFromString(TEXT("20,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardStatisticsLogFont);
propGetFontSettingsFromString(TEXT("22,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardMapWindowLogFont);
propGetFontSettingsFromString(TEXT("19,0,0,0,400,0,0,0,0,0,0,6,2,Tahoma"), ptrhardMapWindowBoldLogFont);
#else
propGetFontSettingsFromString(TEXT("14,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardTitleWindowLogFont);
propGetFontSettingsFromString(TEXT("15,0,0,0,400,0,0,0,0,0,0,4,2,TahomaBD"), ptrhardCDIWindowLogFont);
propGetFontSettingsFromString(TEXT("16,0,0,0,600,0,0,0,0,0,0,4,2,Tahoma"), ptrhardMapLabelLogFont);
propGetFontSettingsFromString(TEXT("20,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardStatisticsLogFont);
propGetFontSettingsFromString(TEXT("22,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardMapWindowLogFont);
propGetFontSettingsFromString(TEXT("19,0,0,0,500,0,0,0,0,0,0,6,2,Tahoma"), ptrhardMapWindowBoldLogFont);
#endif
}
else if (ScreenSize==(ScreenSize_t)ss720x408) { // WQVGA e.g. MIO
propGetFontSettingsFromString(TEXT("21,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardTitleWindowLogFont);
Expand All @@ -171,12 +180,21 @@ void InitialiseFontsHardCoded(RECT rc,
else if (ScreenSize==(ScreenSize_t)ss800x480 ||
(ScreenSize==0 && ScreenLandscape && ScreenGeometry==SCREEN_GEOMETRY_53) )
{
#ifdef __linux__
propGetFontSettingsFromString(TEXT("20,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardTitleWindowLogFont);
propGetFontSettingsFromString(TEXT("28,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardCDIWindowLogFont);
propGetFontSettingsFromString(TEXT("26,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapLabelLogFont);
propGetFontSettingsFromString(TEXT("48,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardStatisticsLogFont);
propGetFontSettingsFromString(TEXT("30,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapWindowLogFont);
propGetFontSettingsFromString(TEXT("32,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapWindowBoldLogFont);
#else
propGetFontSettingsFromString(TEXT("20,0,0,0,200,0,0,0,0,0,0,3,2,Tahoma"), ptrhardTitleWindowLogFont);
propGetFontSettingsFromString(TEXT("28,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardCDIWindowLogFont);
propGetFontSettingsFromString(TEXT("26,0,0,0,600,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapLabelLogFont);
propGetFontSettingsFromString(TEXT("48,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardStatisticsLogFont);
propGetFontSettingsFromString(TEXT("30,0,0,0,600,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapWindowLogFont);
propGetFontSettingsFromString(TEXT("32,0,0,0,500,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapWindowBoldLogFont);
#endif
}
else if (ScreenSize==(ScreenSize_t)ss400x240) {
propGetFontSettingsFromString(TEXT("10,0,0,0,200,0,0,0,0,0,0,3,2,Tahoma"), ptrhardTitleWindowLogFont);
Expand Down Expand Up @@ -255,24 +273,24 @@ void InitialiseFontsHardCoded(RECT rc,
}
//
// ELSE WE DID NOT FIND A VALID CUSTOM RESOLUTION OR A VALID SCREEN GEOMETRY FOR THIS ORIENTATION!
// We use 16:9 480x272 settings, but no warranty!
// We use 16:9 480x272 settings, but no warranty! No boldness.
//
else {
StartupStore(_T(". >> (Fonts) Unknown unsupported screen geometry or resolution%s"),NEWLINE);
if (ScreenLandscape) {
propGetFontSettingsFromString(TEXT("14,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardTitleWindowLogFont);
propGetFontSettingsFromString(TEXT("15,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardCDIWindowLogFont);
propGetFontSettingsFromString(TEXT("16,0,0,0,600,0,0,0,0,0,0,4,2,Tahoma"), ptrhardMapLabelLogFont);
propGetFontSettingsFromString(TEXT("16,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardMapLabelLogFont);
propGetFontSettingsFromString(TEXT("20,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardStatisticsLogFont);
propGetFontSettingsFromString(TEXT("22,0,0,0,400,0,0,0,0,0,0,4,2,Tahoma"), ptrhardMapWindowLogFont);
propGetFontSettingsFromString(TEXT("19,0,0,0,500,0,0,0,0,0,0,6,2,Tahoma"), ptrhardMapWindowBoldLogFont);
propGetFontSettingsFromString(TEXT("19,0,0,0,400,0,0,0,0,0,0,6,2,Tahoma"), ptrhardMapWindowBoldLogFont);
} else {
propGetFontSettingsFromString(TEXT("12,0,0,0,300,0,0,0,0,0,0,3,2,Tahoma"), ptrhardTitleWindowLogFont);
propGetFontSettingsFromString(TEXT("12,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardTitleWindowLogFont);
propGetFontSettingsFromString(TEXT("12,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardCDIWindowLogFont);
propGetFontSettingsFromString(TEXT("15,0,0,0,600,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapLabelLogFont);
propGetFontSettingsFromString(TEXT("15,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapLabelLogFont);
propGetFontSettingsFromString(TEXT("10,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardStatisticsLogFont);
propGetFontSettingsFromString(TEXT("18,0,0,0,600,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapWindowLogFont);
propGetFontSettingsFromString(TEXT("18,0,0,0,500,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapWindowBoldLogFont);
propGetFontSettingsFromString(TEXT("18,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapWindowLogFont);
propGetFontSettingsFromString(TEXT("18,0,0,0,400,0,0,0,0,0,0,3,2,Tahoma"), ptrhardMapWindowBoldLogFont);
}
}

Expand Down Expand Up @@ -462,6 +480,10 @@ void propGetFontSettingsFromString(const TCHAR *Buffer1, LOGFONT* lplf)
if ((pToken = _tcstok_r(NULL, TEXT(","), &pWClast)) == NULL) return;
lfTmp.lfClipPrecision = (unsigned char)_tcstol(pToken, NULL, 10);

// FIXFONTS possible multiplier for FT_Set_Pixel in place of Set_Char_Size
// double mulp=(8.7 / 10.0)*100;
// lfTmp.lfHeight = (int)((lfTmp.lfHeight*mulp)/100.0);

// DEFAULT_QUALITY 0
// RASTER_FONTTYPE 0x0001
// DRAFT_QUALITY 1
Expand Down
6 changes: 4 additions & 2 deletions Common/Source/LKProfileResetDefault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ void LKProfileResetDefault(void) {

// full size overlay by default
OverlaySize = 0;

BarOpacity = 75;
if (IsDithered)
BarOpacity = 100;
else
BarOpacity = 75;

#ifdef PPC2002
FontRenderer = 1; // AntiAliasing
Expand Down
3 changes: 2 additions & 1 deletion lktest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo " (L) GEOMETRY 4:3 (P) "
echo " 1 .. 320x240 6 .. 240x320"
echo " 2 .. 640x480 7 .. 480x640"
echo " 3 .. 800x600 8 .. 600x800"
echo " 4 .. 1024x768 "
echo " 4 .. 1024x768 9 .. 768x1024"
echo " 5 .. 400x300 10 .. 300x400"
echo
echo " (L) GEOMETRY 5:3 (P) "
Expand Down Expand Up @@ -43,6 +43,7 @@ case $a in
6) $xeq -x=240 -y=320 ;;
7) $xeq -x=480 -y=640 ;;
8) $xeq -x=600 -y=800 ;;
9) $xeq -x=768 -y=1024 ;;
10) $xeq -x=300 -y=400 ;;

11) $xeq -x=400 -y=240 ;;
Expand Down

0 comments on commit 8c23455

Please sign in to comment.