Skip to content

Commit

Permalink
External font support
Browse files Browse the repository at this point in the history
git-svn-id: https://irtvo.googlecode.com/svn/trunk@9 aea4ba7e-262c-ea91-1a65-e32e6118e7c5
  • Loading branch information
peberoftyrkisk committed Dec 11, 2010
1 parent 380819a commit 74afb0f
Show file tree
Hide file tree
Showing 9 changed files with 706 additions and 47 deletions.
674 changes: 674 additions & 0 deletions COPYING.txt

Large diffs are not rendered by default.

Binary file modified iRTVO.suo
Binary file not shown.
9 changes: 6 additions & 3 deletions iRTVO/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ private void practiceResultsButton_Click(object sender, RoutedEventArgs e)
SharedData.resultPage = 0;
qualifyResultsButton.IsEnabled = false;
raceResultsButton.IsEnabled = false;
SharedData.visible[(int)SharedData.overlayObjects.sidepanel] = false;
for (int i = 0; i < SharedData.visible.Length; i++)
SharedData.visible[i] = false;
}
else if (SharedData.visible[(int)SharedData.overlayObjects.results] == true && SharedData.resultLastPage == true)
{
Expand Down Expand Up @@ -154,7 +155,8 @@ private void qualifyResultsButton_Click(object sender, RoutedEventArgs e)
SharedData.resultPage = 0;
practiceResultsButton.IsEnabled = false;
raceResultsButton.IsEnabled = false;
SharedData.visible[(int)SharedData.overlayObjects.sidepanel] = false;
for (int i = 0; i < SharedData.visible.Length; i++)
SharedData.visible[i] = false;
}
else if (SharedData.visible[(int)SharedData.overlayObjects.results] == true && SharedData.resultLastPage == true)
{
Expand Down Expand Up @@ -197,7 +199,8 @@ private void raceResultsButton_Click(object sender, RoutedEventArgs e)
SharedData.resultPage = 0;
practiceResultsButton.IsEnabled = false;
qualifyResultsButton.IsEnabled = false;
SharedData.visible[(int)SharedData.overlayObjects.sidepanel] = false;
for (int i = 0; i < SharedData.visible.Length; i++)
SharedData.visible[i] = false;
}
else if (SharedData.visible[(int)SharedData.overlayObjects.results] == true && SharedData.resultLastPage == true)
{
Expand Down
8 changes: 7 additions & 1 deletion iRTVO/iRTVO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>0.99.0.0</ApplicationVersion>
<ApplicationVersion>0.100.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down Expand Up @@ -155,6 +155,12 @@
<Content Include="themes\FIA Style\settings.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="themes\FIA Style\DejaVuSans.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="themes\FIA Style\DejaVuSansMono.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Resource Include="iRTVO.ico" />
Expand Down
27 changes: 0 additions & 27 deletions iRTVO/overlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,6 @@ private void overlayUpdate(object sender, EventArgs e)
SharedData.standingMutex.WaitOne(5);
SharedData.sessionsMutex.WaitOne(5);

/* disabled temporarily
// hide/show objects
// driver
if (SharedData.visible[(int)SharedData.overlayObjects.driver])
driver.Visibility = System.Windows.Visibility.Visible;
else
driver.Visibility = System.Windows.Visibility.Hidden;
// sidepanel
if (SharedData.visible[(int)SharedData.overlayObjects.sidepanel])
sidepanel.Visibility = System.Windows.Visibility.Visible;
else
sidepanel.Visibility = System.Windows.Visibility.Hidden;
// replay
if (SharedData.visible[(int)SharedData.overlayObjects.replay])
oReplay.Visibility = System.Windows.Visibility.Visible;
else
oReplay.Visibility = System.Windows.Visibility.Hidden;
// replay
if (SharedData.visible[(int)SharedData.overlayObjects.sessionstatus])
oSessionState.Visibility = System.Windows.Visibility.Visible;
else
oSessionState.Visibility = System.Windows.Visibility.Hidden;
*/

// hide/show objects
// driver
if (SharedData.visible[(int)SharedData.overlayObjects.driver])
Expand Down
9 changes: 6 additions & 3 deletions iRTVO/theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public struct LabelProperties
public ObjectProperties results;
public LabelProperties resultsHeader;
public LabelProperties resultsSubHeader;
//public ObjectProperties sessionstate;
public LabelProperties sessionstateText;

public Theme(string themeName)
Expand Down Expand Up @@ -91,7 +90,6 @@ public Theme(string themeName)
resultsHeader = loadLabelProperties("Results", "header");
resultsSubHeader = loadLabelProperties("Results", "subheader");

//sessionstate = loadProperties("Sessionstate");
sessionstateText = loadLabelProperties("Sessionstate", "text");

}
Expand Down Expand Up @@ -123,7 +121,12 @@ private LabelProperties loadLabelProperties(string prefix, string suffix)
lp.width = Int32.Parse(getIniValue(prefix + "-" + suffix, "width"));
lp.height = Int32.Parse(getIniValue(prefix + "-" + suffix, "fontsize")) * 3;
lp.fontSize = Int32.Parse(getIniValue(prefix + "-" + suffix, "fontsize"));
lp.font = new System.Windows.Media.FontFamily(getIniValue(prefix + "-" + suffix, "font"));
if (File.Exists(@Directory.GetCurrentDirectory() + "\\" + path + "\\" + getIniValue(prefix + "-" + suffix, "font")))
{
lp.font = new System.Windows.Media.FontFamily(new Uri(Directory.GetCurrentDirectory() + "\\" + path + "\\" + getIniValue(prefix + "-" + suffix, "font")), getIniValue(prefix + "-" + suffix, "font"));
}
else
lp.font = new System.Windows.Media.FontFamily(getIniValue(prefix + "-" + suffix, "font"));
lp.fontColor = (System.Windows.Media.SolidColorBrush)new System.Windows.Media.BrushConverter().ConvertFromString(getIniValue(prefix + "-" + suffix, "fontcolor"));

if (getIniValue(prefix + "-" + suffix, "fontbold") == "true")
Expand Down
Binary file added iRTVO/themes/FIA Style/DejaVuSans.ttf
Binary file not shown.
Binary file added iRTVO/themes/FIA Style/DejaVuSansMono.ttf
Binary file not shown.
26 changes: 13 additions & 13 deletions iRTVO/themes/FIA Style/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ top=578

[Driver-num]
width=50
font=Arial
font=DejaVuSans.ttf
fontsize=30
fontcolor=white
fontbold=true
Expand All @@ -23,17 +23,17 @@ top=3

[Driver-name]
width=400
font=Arial
font=DejaVuSans.ttf
fontsize=34
fontcolor=white
fontbold=true
fontbold=false
align=left
left=120
top=0

[Driver-diff]
width=120
font=Arial
font=DejaVuSans.ttf
fontsize=20
fontcolor=white
fontbold=true
Expand All @@ -56,7 +56,7 @@ itemheight=32
; number labels
[Sidepanel-num]
width=35
font=Arial
font=DejaVuSans.ttf
fontsize=22
fontcolor=black
fontbold=true
Expand All @@ -66,7 +66,7 @@ top=0

[Sidepanel-name]
width=90
font=Consolas
font=DejaVuSansMono.ttf
fontsize=22
fontcolor=white
fontbold=true
Expand All @@ -76,7 +76,7 @@ top=0

[Sidepanel-diff]
width=100
font=Arial
font=DejaVuSans.ttf
fontsize=20
fontcolor=white
fontbold=true
Expand All @@ -99,7 +99,7 @@ itemheight=50
; number labels
[Results-num]
width=40
font=Arial
font=DejaVuSans.ttf
fontsize=28
fontcolor=white
fontbold=true
Expand All @@ -109,7 +109,7 @@ top=97

[Results-name]
width=280
font=Arial
font=DejaVuSans.ttf
fontsize=25
fontcolor=white
fontbold=true
Expand All @@ -119,7 +119,7 @@ top=97

[Results-diff]
width=215
font=Arial
font=DejaVuSans.ttf
fontsize=25
fontcolor=white
fontbold=true
Expand All @@ -130,7 +130,7 @@ top=97
[Results-header]
width=450
height=50
font=Arial
font=DejaVuSans.ttf
fontsize=28
fontcolor=black
fontbold=true
Expand All @@ -141,7 +141,7 @@ top=0
[Results-subheader]
width=460
height=30
font=Arial
font=DejaVuSans.ttf
fontsize=20
fontcolor=white
fontbold=true
Expand All @@ -153,7 +153,7 @@ fontitalic=true
[Sessionstate-text]
width=100
height=40
font=Arial
font=DejaVuSans.ttf
fontsize=25
fontcolor=white
fontbold=true
Expand Down

0 comments on commit 74afb0f

Please sign in to comment.