Jump to content
LaunchBox Community Forums

Override automatic scaled font size in game listings


Artik

Recommended Posts

Hi!

Starting to custom my own theme, I'm facing an issue that after browsing google and the forum I couldn't find a working solution. I simply want to reduce the font size of left listings. I managed to change the font style, but not the style.

I understood that this listing is scaled automatically regarding the Windows screen settings, but there is no way to force it to be smaller? I spent a night without success, so here is my topic.

I tried to edit ListBoxItemStyle.xaml, textlist, etc. But nothing to do. If it's not implemented yet, I really thing it's a feature you would consider, as it's something requested by many designers/skinners :)

If there is a solution, I'm really looking for it, as it's my last setting needed to be changed to have a nice skin. thanks!

Link to comment
Share on other sites

The font settings (including size) are configurable in the LaunchBox options, so that is one thing to note. However, lots of themes have overridden this with custom fonts; I don't think there's anything preventing you from doing that. Maybe you can take a look at some of the other LaunchBox themes for an example? If you're still stuck, post some code here that isn't working and hopefully we can help.

Link to comment
Share on other sites

56 minutes ago, Artik said:

Hi Jason, thanks for reply. My topic concerns BigBox, sorry for missunderstanding

Oic. Depending on the view, the font sizes are almost always set via the name of the TextBlock, or whatever element you're working with. So generally, if you change the name, then the font size will not be overridden. :)

Link to comment
Share on other sites

Ok, have to try it tomorrow. And I spent 4 hours without any luck last week :)

Thanks to Faeran, he gave me the solution using this plugin: 

Now I can manage the size of the listing's font. Need to understand now how to change the FontFamily

 

Link to comment
Share on other sites

On 3/26/2019 at 8:49 PM, Jason Carr said:

Oic. Depending on the view, the font sizes are almost always set via the name of the TextBlock, or whatever element you're working with. So generally, if you change the name, then the font size will not be overridden. :)

Ok, I tried what you said, unfortunately, I still can't change any fontsize in the gamelist. I think I understood your suggestion. So I edited my TextGameView.xaml with these settings:

<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
			 mc:Ignorable="d"
			 d:DesignHeight="300"
			 d:DesignWidth="300"
			 HorizontalAlignment="Stretch"
			 MaxWidth="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
			 FocusVisualStyle="{x:Null}">
	<Border Name="Border" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}">
		<DockPanel>
			<TextBlock Name="Favorite" DockPanel.Dock="Left" Visibility="{Binding FavoriteVisibility}" Foreground="#ff3434" FontFamily="LAUNCHBOX_ROOT_FOLDER/Themes/CityHunter 2/Fonts/FreeDesign001Bitbit.ttf#FreeDesign001Bitbit" FontSize="10" ></TextBlock>
			<TextBlock Name="Title" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Stretch" FontFamily="LAUNCHBOX_ROOT_FOLDER/Themes/CityHunter 2/Fonts/FreeDesign001Bitbit.ttf#FreeDesign001Bitbit" FontSize="10" Foreground="white" />
		</DockPanel>
	</Border>
</UserControl>

As you can see, the custom fontfamily is working on my screenshot, but not the fontsize. I tried to change as you suggested the  Name="Title" (thinking that all "Title" have the same fontsize.

But the game list disappears.

 

I tried also another Name that exists (maybe the fontsize will be smaller) so I tried Name="PlatformDetails"

Listing disappears too.

 

Honestly, if you find the way to get a custom font with customisable fontsize, it would be amazing. Hours spent to find the magic solution. Help will be really appreciated haha.

 

Actual state of the skin's mod:

 

4HSJ1UC.jpg

Edited by Artik
Link to comment
Share on other sites

  • 2 weeks later...

Little up @Jason . Honestly I really think we have a bug here, some fonts sizes are impossible to change (like the game listing) without using a plugin, and with plugin the fontfamily doesn't work, last step for me to finish the skin :)

A fix is welcome, because your last commit with .tff linking is amazing!

Link to comment
Share on other sites

35 minutes ago, Artik said:

Little up @Jason . Honestly I really think we have a bug here, some fonts sizes are impossible to change (like the game listing) without using a plugin, and with plugin the fontfamily doesn't work, last step for me to finish the skin :)

A fix is welcome, because your last commit with .tff linking is amazing!

Hi Artik, if you're still unable to set the font size after changing the name, then it's definitely a XAML/WPF issue, and rather than a bug, it's more likely just an issue with XAML priorities and such.

I checked the code behind the TextGameView, and it only changes the font size from the backend if the names are "Title" and "Favorite". If you change those names, then it should allow you to change the font size without issues. However, it's also possible that the font size is being set via the parent ListView or ListBox, or something of that nature. Unfortunately I'm not home to experiment right now, but if there is a glitch, it would have to be with WPF or XAML, and I doubt WPF or XAML would have such a glaring glitch. Most likely there's something misleading that is overriding the font size. Also, make sure that the TextGameView is, in fact, the view that is being used in the area that you're trying to change.

Link to comment
Share on other sites

On 4/10/2019 at 1:50 PM, Jason Carr said:

Hi Artik, if you're still unable to set the font size after changing the name, then it's definitely a XAML/WPF issue, and rather than a bug, it's more likely just an issue with XAML priorities and such.

I checked the code behind the TextGameView, and it only changes the font size from the backend if the names are "Title" and "Favorite". If you change those names, then it should allow you to change the font size without issues. However, it's also possible that the font size is being set via the parent ListView or ListBox, or something of that nature. Unfortunately I'm not home to experiment right now, but if there is a glitch, it would have to be with WPF or XAML, and I doubt WPF or XAML would have such a glaring glitch. Most likely there's something misleading that is overriding the font size. Also, make sure that the TextGameView is, in fact, the view that is being used in the area that you're trying to change.

Well, I spent so many time that all you suggest has been already tried. If I change  the name Title in <TextBlock Name="Title" > by anything else, I have an error.

I also tried to look all parent files, and I can't find any file that could override the TextGameView.xaml (and yes, this is one of the 3 files I want to change the fontsize/family)

Strange the a plugin exists to do it.

 

Any help is really appeciated, would love to finish the skin and post it. @Jason can you try at home and let me know if you figured it out?

Link to comment
Share on other sites

On 4/14/2019 at 8:40 AM, Artik said:

Well, I spent so many time that all you suggest has been already tried. If I change  the name Title in <TextBlock Name="Title" > by anything else, I have an error.

I also tried to look all parent files, and I can't find any file that could override the TextGameView.xaml (and yes, this is one of the 3 files I want to change the fontsize/family)

Strange the a plugin exists to do it.

 

Any help is really appeciated, would love to finish the skin and post it. @Jason can you try at home and let me know if you figured it out?

Ah, okay. So the issue is that you can't change the name of the text box without getting an error? What is the error that you're getting?

Link to comment
Share on other sites

On 4/16/2019 at 8:06 PM, Jason Carr said:

Ah, okay. So the issue is that you can't change the name of the text box without getting an error? What is the error that you're getting?

Damn, the error was because I made a mistake with double TextBlock with same name. So I tried to rename as "test". Nothing appears:

xPU6AcF.jpg

Link to comment
Share on other sites

2 hours ago, Jason Carr said:

Ah, I see. Try adding a Text property binding like this:


<TextBlock Name="Test" Text="{Binding Name}" />

 

Solution found!!! 

 

TextGameView.xaml (for the games listing) :

<TextBlock Name="GamesListing" Text="{Binding Path=Title}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Stretch" FontFamily="LAUNCHBOX_ROOT_FOLDER/Themes/Arcadust/Fonts/FreeDesign001Bitbit.ttf#FreeDesign001Bitbit" FontSize="20" Foreground="white" />

 

FilterView.xaml (for the categories listing) :

<TextBlock Name="CategoriesListing" Text="{Binding Path=Name}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Stretch" FontFamily="LAUNCHBOX_ROOT_FOLDER/Themes/Arcadust/Fonts/FreeDesign001Bitbit.ttf#FreeDesign001Bitbit" FontSize="20" Foreground="white" />

 

MenuItemView.xaml (for the settings listing) :

<TextBlock Name="MenuItems" Text="{Binding Path=Text}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Stretch" FontFamily="LAUNCHBOX_ROOT_FOLDER/Themes/Arcadust/Fonts/FreeDesign001Bitbit.ttf#FreeDesign001Bitbit" FontSize="20" Foreground="white" />

Many thanks @Jason a big big step!

 

bOpLSpw.jpg

 

Edited by Artik
  • Game On 1
Link to comment
Share on other sites

I continue this topic if I'm facing little issue to avoid creating a new topic.

Do you know if on the categorie listing (here I have 4 catégories) To add the number of games icluded in each one of them ?

 

I know we have this number (displayed down right) but how to include it after the category's name ? I tried to edit the FilterView.xml, but I always have an error . How can I do it ?

 

<TextBlock Name="CategoriesListing" Text="{Binding Path=Name} (253)" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" HorizontalAlignment="Stretch" FontFamily="LAUNCHBOX_ROOT_FOLDER/Themes/Arcadust/Fonts/FreeDesign001Bitbit.ttf#FreeDesign001Bitbit" FontSize="20" Foreground="white" />

 

KeaYQ87.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...