Board index FlightGear Support Graphics

4K Displays and Tiny Text -- PLIB & PUI Problems?  Topic is solved

Graphics issues like: bad framerates, weird colors, OpenGL errors etc. Bad graphics ar usually the result of bad graphics cards or drivers.
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- what graphics card do you have?
- does the problem occur with any aircraft, at any airport?
- is there any output printed to the console (black window)?
- copy&paste your commandline (tick the "Show commandline box on the last page of FGRun or the "Others" section on the Mac launcher).
- please upload a screenshot of the problem.

If you experience FlightGear crashes, please report a bug using the issue tracker (can be also used for feature requests).
To run FlightGear on old computers with bad OpenGL support, please take a look at this wiki article. If you are seeing corrupted/broken textures, please see this article.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

4K Displays and Tiny Text -- PLIB & PUI Problems?

Postby downpilot » Fri Feb 21, 2020 9:58 pm

Greetings, all,

I'm a flightgear user since about 2012 or so and generally I am _extremely satisfied_ and have had many hours of excellent fun.

However, now I have problems in the world of 4K displays.

Equipment:

Debian 10 "testing", basically "buster" but if something new comes out, I get it first.
Machine: Intel e3-1275, "loaded"
NVidia 2070 "super"
Display: TCL 43" 4K
Relevant software details:
FlightGear version: 2019.1.1
SimGear version: 2019.1.1
OSG version: 3.6.4
PLIB version: 185

Problem: UNREADABLY SMALL TEXT in 4K Mode

I have tracked the problem down to problems with PLIB and PUI, and dealing with either of those is far beyond my abilities.

Asking the developers to depart from their immense tasks, which I understand include alternatives to PLIB etc., isn't something I feel able to do. Yet, I need to mention that I have been able to make FG _more_ usable, if not effortlessly usable, by twidding in:

/usr/share/games/flightgear/gui/styles/anthrax.xml

where it allows you to tweak the font settings. Yet, here we encounter another problem.

A huge "can of worms" for the developer is that dependence on older OpenGL and comparable systems. Here I have to mention that I can build PLIB from source on Debian, but it leaves out a huge number of commandline "example" and "testing" apps which no longer are included in the build tree.

Fonts for FG are in the TXF format which is almost impossible for many modern Linux users to manipulate, or even to examine. One commonly-recommended commandline tool, `ttf2txf`, is effectively not buildable without reverting to commandline, installing a late-model OpenGL compiled from source with the libraries attached static. (Compiling with shared libraries won't work after you rip out OpenGL and revert to a stock modern Debian.) etc etc etc. As the saying goes, I've been "shaving a yak" for a few days on this.

The Helvetica TXF font which is just fine (except for being basically too small to read) needs merely to be supplied with larger font sizes and those could be selected for display in the "anthrax.xml" file and we'd be flying happy again.

So, I want to ask the developers, or anyone else who has the capability, to please create a new Helvetica.txf which also contains a set of fonts roughly double the size of what looks good on a "1K" 1080 display. That is the quick fix.

Additionally, you might want to try to find those fun little helper applications such as `ttf2txf`, `fnt_test`,etc etc, and make sure they get back into circulation. That way we could at least look at the TXF font files and pick a proper font size instead of having to guess.

Now that I'm done complaining, aside from the bit with the font sizes and near illegibility (the Helvetica.txf has some font sizes such as 18pt that can be read with some squinting), I otherwise need to commend all of the developers for their exceptional product. The 4K display combines with general scalability across most of the rest of the system, to make the views out of the "windows" almost photorealistic.

I appreciate any help anyone can bring on this matter, as it's a fast and easy "quick fix" for bringing `fgfs` to the 4K world. Regards,
downpilot
 
Posts: 6
Joined: Fri Feb 21, 2020 9:14 pm

Re: 4K Displays and Tiny Text -- PLIB & PUI Problems?

Postby xen_steda » Fri Feb 21, 2020 10:11 pm

Hello, I know this may not solve every issue you are having but in the Debug menu once inside a plane there is a "Cycle GUI Style" button that makes the GUI font a little bigger.
xen_steda
 
Posts: 234
Joined: Sun Jan 05, 2020 3:53 pm

Re: 4K Displays and Tiny Text -- PLIB & PUI Problems?

Postby downpilot » Sat Feb 22, 2020 3:33 am

I just tried that. It does load a different font, but actually it's a little smaller.
downpilot
 
Posts: 6
Joined: Fri Feb 21, 2020 9:14 pm

Re: 4K Displays and Tiny Text -- PLIB & PUI Problems?

Postby downpilot » Sat Feb 22, 2020 3:49 am

From my anthrax.xml:

<!--

<fonts>
<gui>
<name type="string">HELVETICA_18</name>
<baseline-height type="float">21</baseline-height>
</gui>

<splash>
<name type="string">default.txf</name>
<size type="float">19</size>
<slant type="float">0</slant>
</splash>

<gui-large>
<name>HELVETICA_18</name>
</gui-large>

<fixed>
<name>FIXED_8x13</name>
</fixed>

-->

etc etc.

I'm tempted to spend most of tomorrow editing the anthrax.xml and checking the changes as they appear in operation.

The anthrax.xml file does have a comment to the effect that I can use any font in the $FG_ROOT/Fonts/ directory but the problem I have at the moment is that I have to _guess_ at what sizes are available from any fonts.

The comment at the top of the anthrax.xml file says:

<!-- possible font names:
"default", "FIXED_8x13", "FIXED_9x15", "TIMES_10", "TIMES_24",
"HELVETICA_10", "HELVETICA_12", "HELVETICA_14", "HELVETICA_18",
"SANS_12B", and all font file names from $FG_ROOT/Fonts/, such as
"helvetica_bold.txf". "size" and "slant" take only effect on
texture fonts.
-->

I may try, for example, the TIMES_24 as that would give me the right size. But where is a HELVETICA_24 which would be just about perfect? Any tool which could allow creation of a TXF file with larger font sizes would be very helpful.

Thanks to all,
downpilot
 
Posts: 6
Joined: Fri Feb 21, 2020 9:14 pm

Re: 4K Displays and Tiny Text -- PLIB & PUI Problems?

Postby downpilot » Sat Feb 22, 2020 3:54 am

The TIMES_24 works well enough for the menu. TIMES_28 or TIMES_32 would be ideal.

I hope this will be helpful to anyone else!
downpilot
 
Posts: 6
Joined: Fri Feb 21, 2020 9:14 pm

Re: 4K Displays and Tiny Text -- PLIB & PUI Problems?

Postby Hooray » Sat Feb 22, 2020 10:21 am

Note that you can cycle/reload the GUI at runtime (see the debug menu) and that all available fonts can be found in $FG_ROOT/Fonts: https://sourceforge.net/p/flightgear/fg ... ree/Fonts/

I don't think this is anywhere documented properly, so it would be great if you could post your journey here and/or add a corresponding tutorial to the wiki.
At least on Linux, I believe it should be straightforward to find tools to view/edit TXF files as needed.

If in doubt, there are dedicated font creation/manipulation tools - having a corresponding FlightGear specific tutorial would obviously be great.

I suppose you could also review the commits logs for $FG_ROOT/Fonts and reach out to the people who have previously contributed to this area of FG: https://sourceforge.net/p/flightgear/fg ... ath=/Fonts

As a matter of fact, since FlightGear uses OpenSceneGraph, and since OSG supports TXF, I believe that we could use Nasal/Canvas to display a list of fonts and even preview them inside fgfs (?)

To see for yourself, modify the Canvas image example to point to a font file:

http://wiki.flightgear.org/Canvas_Snipp ... ter_Images
http://wiki.flightgear.org/Canvas_Image

If this works, this can be trivially extended to show a list of all fonts including a preview, by adapting this snippet: http://wiki.flightgear.org/Canvas_Snipp ... ScrollArea

Alternatively, it would be possible to render the menubar completely using the Canvas system: http://wiki.flightgear.org/Howto:Making ... as_Menubar
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am

Re: 4K Displays and Tiny Text -- PLIB & PUI Problems?

Postby downpilot » Sat Feb 22, 2020 12:58 pm

Thank you so much, "Hooray"! This is an excellent selection of tips and clue. Certainly it should keep me busy for a day or two.

I don't know that I feel up to tackling a task of "decent" documentation in a top-down form, but I'll certainly take notes as I go. When and if I get anything that's perfectly functional for me, I'll cheerfully share it and perhaps a better documentarian can push it into shape for the Docs.

For now: just getting a usable menubar, etc., has been accomplished, simply by a search-and-replace of HELVETICA_* with TIMES_24.

Thanks again, and I'll look into your suggestions!

Regards,
downpilot
 
Posts: 6
Joined: Fri Feb 21, 2020 9:14 pm

Re: 4K Displays and Tiny Text -- PLIB & PUI Problems?  

Postby downpilot » Sun Feb 23, 2020 8:12 pm

"Hooray":

Regarding your suggestion:

> To see for yourself, modify the Canvas image example to point to a font file:
>
> http://wiki.flightgear.org/Canvas_Snipp ... ter_Images
> http://wiki.flightgear.org/Canvas_Image

I have been unable to get this exact thing to work for me.

Those are valuable tutorials with examples, and I have given many of them a try, but haven't been able yet to get these working for my purpose of finding fonts easily used in the menubar (etc) for a 4K display. Many do work just fine, but they aren't solving my particular problem. For me, it's satisfactory -- for now -- to use the TIMES_24 for the menubar. For others who may have any problems with eyesight, probably there needs to be something better. I'll just poke through the various fonts and see if anything can be adapted. Yet this still doesn't help me know what are my font options, it's all trial and error.

Regards,
downpilot
 
Posts: 6
Joined: Fri Feb 21, 2020 9:14 pm

Re: 4K Displays and Tiny Text -- PLIB & PUI Problems?

Postby Hooray » Mon Feb 24, 2020 11:19 am

Okay, how about trying the following:

Open the Nasal Console: http://wiki.flightgear.org/Nasal_Console

Next, copy/paste the following snippet, into the console (taken from: http://wiki.flightgear.org/Nasal_Hello_World ):
Code: Select all
gui.popupTip("Hello, World!");


click "Execute"

This should show a tooltip/message saying "Hello World".

Once that works, try the following snippet instead:
Code: Select all
var (width,height) = (320,160);
var title = 'Font Browser (by downpilot)';

# create a new window, dimensions are WIDTH x HEIGHT, using the dialog decoration (i.e. titlebar)
var window = canvas.Window.new([width,height],"dialog")
 .set('title',title);

# adding a canvas to the new window and setting up background colors/transparency
var myCanvas = window.createCanvas().set("background", canvas.style.getColor("bg_color"));

# Using specific css colors would also be possible:
# myCanvas.set("background", "#ffaac0");

# creating the top-level/root group which will contain all other elements/group
var root = myCanvas.createGroup();

# path is relative to $FG_ROOT (base package)
var path = "Textures/Splash1.png";
# create an image child for the texture
var child = root.createChild("image")
    .setFile(path)
    .setTranslation(100, 10)
    .setSize(130, 130);


Once that works, go to the line that contains "Texture/Splash1.png" - adapt that as needed to replace the image path with a font file from $FG_ROOT/Fonts: https://sourceforge.net/p/flightgear/fg ... ree/Fonts/

For instance, use "Fonts/Helvetica.txf" - next, click execute again.

IF this works as expected, it should load the font file from the base package and display it.

Once that is the case, the example can be easily extended to show a scroll-able list of all fonts by adapting the VerticalScrollArea example I mentioned above.

I am currently not in a position to try this myself, but if you could report back here, I am confident that we should be able to work out the few code changes needed to come up with a little "font browser" utility.

In other words, if you can get the example working, and if you can get it to load not just the splash screen texture, but also the "Helvetica.txf" font file, it would only take 2-3 more postings to adapt the snippet into a useful little tool to show a list of all fonts.

If you're interested in working on this, feel free to post a few screen shots here - or even document your journey in the wiki, by adding a short little tutorial to it.

Again, I can provide the code snippets, all you will have to do is to test things, post screen shots and tell us what else you need in terms of functionality.

So there is no coding involved on your end if you don't want to. The point being, I am posting from a mobile device, so I am not in a good position to run/test any Nasal/Canvas code, but I have written a ton of Nasal and Canvas related tutorials and code, and so have others here, so we can probably get you going rather quickly, even without you having to do anything in terms of "coding", other than executing snippets of code, posting/sharing screen shots and telling us what else you'd like the snippet to do.

As far as I can tell, creating a working "font browser" utility should not take more than 20 lines of code, all of which is readily available in the wiki.

And it would be great if you could document your journey by contributing to such a wiki article, adding your screen shots to it - even if you can only dedicate 5 minutes a day to this, the "font browser" could be finished by friday ;-)

So I have added a stub to the wiki, in the hope that you might be interested in gettin involved there: http://wiki.flightgear.org/Howto:Creati ... and_Canvas

You will need a wiki account, and might want to take a quick look at the help to see how articles can be edited (not needed if you are familiar with wikipedia/wikimedia): http://wiki.flightgear.org/Help:Your_first_article
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11836
Joined: Tue Mar 25, 2008 8:40 am


Return to Graphics

Who is online

Users browsing this forum: No registered users and 1 guest