remove FontBaseZoom in favor of doubleres font textures. This is cleaner and doesn't have weird interactions with maxwidth, wrapwidthpixels, etc

This commit is contained in:
Chris Danford
2008-05-27 17:08:25 +00:00
parent 94c489bae0
commit 0544328038
34 changed files with 17 additions and 44 deletions
@@ -7,8 +7,8 @@ return Def.ActorFrame {
LoadFont("_terminator two 60") .. {
InitCommand=cmd(y,-150;settext,ScreenString("Warning");diffuse,color("#fef500");strokecolor,color("#0167d2");shadowlength,0);
};
LoadFont("_venacti bold 30") .. {
InitCommand=cmd(y,20;settext,ScreenString("BodyText");wrapwidthpixels,1000;strokecolor,color("#0167d2");shadowlength,0);
LoadFont("_venacti Bold 15px") .. {
InitCommand=cmd(y,20;settext,ScreenString("BodyText");uppercase,true;wrapwidthpixels,500;strokecolor,color("#0167d2");shadowlength,0);
};
};
};
@@ -5,7 +5,6 @@ LineSpacing=38
DrawExtraPixelsLeft=3
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=12
1=12
2=12
@@ -5,7 +5,6 @@ LineSpacing=43
DrawExtraPixelsLeft=3
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -6,7 +6,6 @@ DrawExtraPixelsLeft=3
DrawExtraPixelsRight=0
AdvanceExtraPixels=3
ScaleAllWidthsBy=1.2068965517241379310344827586207
FontBaseZoom=0.5
0=4
1=4
2=4
@@ -6,7 +6,6 @@ DrawExtraPixelsLeft=0
DrawExtraPixelsRight=0
AdvanceExtraPixels=3
ScaleAllWidthsBy=1.2068965517241379310344827586207
FontBaseZoom=0.5
0=4
1=4
2=4
@@ -5,7 +5,6 @@ LineSpacing=31
DrawExtraPixelsLeft=2
DrawExtraPixelsRight=2
AdvanceExtraPixels=0
FontBaseZoom=0.5
AddToAllWidths=4
0=5
1=5
@@ -5,7 +5,6 @@ LineSpacing=51
DrawExtraPixelsLeft=0
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=7
1=7
2=7
@@ -5,7 +5,6 @@ LineSpacing=60
DrawExtraPixelsLeft=0
DrawExtraPixelsRight=0
AdvanceExtraPixels=2
FontBaseZoom=0.5
0=12
1=12
2=12
@@ -6,7 +6,6 @@ DrawExtraPixelsLeft=0
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
AddToAllWidths=2
FontBaseZoom=0.5
0=6
1=6
2=6
@@ -5,7 +5,6 @@ LineSpacing=32
DrawExtraPixelsLeft=4
DrawExtraPixelsRight=4
AdvanceExtraPixels=0
FontBaseZoom=0.5
DefaultStrokeColor=#00000077
0=8
1=8
@@ -5,7 +5,6 @@ LineSpacing=36
DrawExtraPixelsLeft=1
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
DefaultStrokeColor=#FFFFFF00
0=15
1=15
@@ -4,7 +4,6 @@ LineSpacing=40
DrawExtraPixelsLeft=0
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
DefaultStrokeColor=#FFFFFF
[numbers]
@@ -5,7 +5,6 @@ LineSpacing=51
DrawExtraPixelsLeft=4
DrawExtraPixelsRight=4
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=8
1=8
2=8
@@ -5,7 +5,6 @@ LineSpacing=54
DrawExtraPixelsLeft=4
DrawExtraPixelsRight=4
AdvanceExtraPixels=0
FontBaseZoom=0.5
[numbers]
0=36
@@ -5,7 +5,6 @@ LineSpacing=60
DrawExtraPixelsLeft=0
DrawExtraPixelsRight=0
AdvanceExtraPixels=2
FontBaseZoom=0.5
0=24
1=24
2=24
@@ -5,7 +5,6 @@ LineSpacing=92
DrawExtraPixelsLeft=1
DrawExtraPixelsRight=0
AdvanceExtraPixels=2
FontBaseZoom=0.5
0=21
1=21
2=21
@@ -5,7 +5,6 @@ LineSpacing=60
DrawExtraPixelsLeft=2
DrawExtraPixelsRight=0
AdvanceExtraPixels=2
FontBaseZoom=0.5
0=24
1=24
2=24
@@ -5,7 +5,6 @@ LineSpacing=92
DrawExtraPixelsLeft=2
DrawExtraPixelsRight=0
AdvanceExtraPixels=2
FontBaseZoom=0.5
0=21
1=21
2=21
@@ -5,7 +5,6 @@ LineSpacing=120
DrawExtraPixelsLeft=8
DrawExtraPixelsRight=8
AdvanceExtraPixels=0
FontBaseZoom=0.5
[numbers]
0=67
@@ -5,7 +5,6 @@ LineSpacing=24
DrawExtraPixelsLeft=2
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -5,7 +5,6 @@ LineSpacing=29
DrawExtraPixelsLeft=2
DrawExtraPixelsRight=0
AdvanceExtraPixels=2
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -5,7 +5,6 @@ LineSpacing=28
DrawExtraPixelsLeft=4
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -5,7 +5,6 @@ LineSpacing=96
DrawExtraPixelsLeft=8
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=0
1=0
@@ -6,7 +6,6 @@ DrawExtraPixelsLeft=2
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
DefaultStrokeColor=#FFFFFF00
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -5,7 +5,6 @@ LineSpacing=31
DrawExtraPixelsLeft=3
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -5,7 +5,6 @@ LineSpacing=34
DrawExtraPixelsLeft=3
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -5,7 +5,6 @@ LineSpacing=38
DrawExtraPixelsLeft=3
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -5,7 +5,6 @@ LineSpacing=60
DrawExtraPixelsLeft=5
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
0=0
1=0
2=0
@@ -2,7 +2,6 @@
Top=5
LineSpacing=29
DrawExtraPixelsLeft=2
FontBaseZoom=0.5
[numbers]
Baseline=24
@@ -5,7 +5,6 @@ LineSpacing=60
DrawExtraPixelsLeft=0
DrawExtraPixelsRight=0
AdvanceExtraPixels=0
FontBaseZoom=0.5
[numbers]
Baseline=54
+14 -8
View File
@@ -452,28 +452,34 @@ void BitmapText::SetMaxHeight( float fMaxHeight )
void BitmapText::UpdateBaseZoom()
{
const float fBaseZoom = m_pFont->GetFontBaseZoom();
if( m_fMaxWidth == 0 )
{
this->SetBaseZoomX( fBaseZoom );
this->SetBaseZoomX( 1 );
}
else
{
const float fWidth = GetUnzoomedWidth();
const float fZoom = min( 1, m_fMaxWidth/fWidth ); /* Never increase the zoom. */
this->SetBaseZoomX( fBaseZoom * fZoom );
if( fWidth != 0 ) // don't divide by 0
{
/* Never decrease the zoom. */
const float fZoom = min( 1, m_fMaxWidth/fWidth );
this->SetBaseZoomX( fZoom );
}
}
if( m_fMaxHeight == 0 )
{
this->SetBaseZoomY( fBaseZoom );
this->SetBaseZoomY( 1 );
}
else
{
const float fHeight = GetUnzoomedHeight();
const float fZoom = min( 1, m_fMaxHeight/fHeight ); /* Never increase the zoom. */
this->SetBaseZoomY( fBaseZoom * fZoom );
if( fHeight != 0 ) // don't divide by 0
{
/* Never decrease the zoom. */
const float fZoom = min( 1, m_fMaxHeight/fHeight );
this->SetBaseZoomY( fZoom );
}
}
}
-2
View File
@@ -228,7 +228,6 @@ Font::Font()
m_iRefCount = 1;
m_pDefault = NULL;
m_bRightToLeft = false;
m_fFontBaseZoom = 1;
m_DefaultStrokeColor = RageColor(1,1,1,1);
m_bStrokeIsUnder = true;
}
@@ -692,7 +691,6 @@ void Font::Load( const RString &sIniPath, RString sChars )
ini.RenameKey("Char Widths", "main");
ini.GetValue( "main", "CapitalsOnly", bCapitalsOnly );
ini.GetValue( "main", "RightToLeft", m_bRightToLeft );
ini.GetValue( "main", "FontBaseZoom", m_fFontBaseZoom );
RString s;
if( ini.GetValue( "main", "DefaultStrokeColor", s ) )
m_DefaultStrokeColor.FromString( s );
-2
View File
@@ -147,7 +147,6 @@ public:
void SetDefaultGlyph( FontPage *pPage );
bool IsRightToLeft() const { return m_bRightToLeft; };
float GetFontBaseZoom() const { return m_fFontBaseZoom; };
const RageColor &GetDefaultStrokeColor() const { return m_DefaultStrokeColor; };
const bool GetStrokeIsUnder() const { return m_bStrokeIsUnder; };
@@ -168,7 +167,6 @@ private:
// There may be a better way to handle this.
bool m_bRightToLeft;
float m_fFontBaseZoom;
RageColor m_DefaultStrokeColor;
bool m_bStrokeIsUnder; // draw stroke under if true, over if false
+1 -1
View File
@@ -212,7 +212,7 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 "$(intdir)\verstub.obj""
AdditionalDependencies="libjpeg/jpeg.lib libpng/lib/libpng.lib"
OutputFile="../Program/StepMania-fastdebug.exe"
OutputFile="..\Program\StepMania-fastdebug.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=""