![]() |
Forum Index : Microcontroller and PC projects : GFXterm on Linux
Author | Message | ||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 586 |
@rob as per your request in the pm's we had. It is the graphic part as every thing else works flawlessly. May need a graphics dll for wine to use or ![]() I upgraded to wine 2.0 just in case. I have wine running it as if it is windows 7. The next part I'll have to check is I am running in 64bit that maybe the cause. Going to load wine on my other work system and make wine 32bit then try it out. It'll be after the new year before I can get to trying to do a linux build as just to many task going right now. 10 controllers with different code sets 4,3,3 and working on 3 Hats for four of matherp 28pin Hat Stands I have coming. Then coding them up Here is a few screen shots that may help you in showing me what will need to be worked out. ![]() ![]() ![]() ![]() ![]() ![]() Hope this helps point to what is going on under wine. Thank for your GREAT TOOL to the Mighty Mites Tool Box. Quazee137 I love the paste over xmodem for quick code checks. yes I am using it to send code to mites. ![]() |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2409 |
aha, it looks like wine and/or linux is doing font substitution. GFXterm requires two fonts to display the terminal window correctly: "Terminal" at [9, 12, 14] point in [regular, bold, underline]. "Courier New" at 8 point, in regular. these fonts are both monospaced (ie, every character is the same width), whereas the terminal window font in your screenshots has variable-width (the letter 'i' is narrower than the letter "m"). the best solution is to ensure that "Terminal" is present and correctly mapped. next best solution is to map in "Courier New" or "Courier" as a substitute, or at least some other monospaced font. i'll look into how "Terminal" (or an open-source alternative) can be bound into the GFXterm.exe executable. cheers, rob :-) |
||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 586 |
Yea! Looking for other mono fonts and try out. This one is an old dot type Terminal.ttf and GFXterm - wine finds it. ![]() Here is a sample of mono fonts on my system 2017-11-20_070557_Font_Samples.pdf I looked in the win8 part of my drive ( had to keep or lose warranty ) did not find font Terminal.ttf as it turns out it is a "character" driver problem. ![]() Where can I get the Terminal font from? |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2409 |
i've been checking out mono fonts online and come up blank in terms of free ones that provide a full set of 256 characters. this wikipedia page suggests it should have been easy, with 'Terminal' and variants used all over the place: https://en.wikipedia.org/wiki/Terminal_(typeface) has anyone else got any ideas or suggestions? below is a small utility i whipped up for testing the fonts on your system, displaying the full 256 characters as GFXterm would display them, except with red lines around the edges. to be useful none of the characters in a font should extend over the red grid: 2017-11-22_002136_font_viewer.zip cheers, rob :-) |
||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 586 |
It looks like I may just make a font to use. I grabbed 3 font editors and will play around to see which works best. Can I get from you the information needed to make the font compatible with what your using. Quazee137 |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2409 |
there is nothing special about the fonts used, apart from needing to be monospaced. bitmapped fonts are preferable as you then know exactly what they will look like on screen, and there should be bold and underlined variants if at all possible. i'm also toying with the idea of simply taking the "Terminal" font and converting it into a set of embedded graphics. this would 100% solve the problem! i'm really not sure what copyrights would apply under such conditions, as it looks like the version of Terminal bundled with windows is property of micro$oft. i could also just allow the user to freely use any font available on their system, but then there is no guarantee that the top 128 characters would always be the same. btw, command line switches to select numbers of rows and colums doesn't help i'm afraid. and i've also hit a technical problem with windows refusing to create a 132 column version (it truncates at 129 columns due to the way i'm constructing the interface). cheers, rob :-) |
||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 586 |
Rob I opened up the image of the character set and had a bit of a laugh as I had seen that long long ago. Code page 437 ![]() Quazee137 |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2409 |
as an experiment i added an option to select the font using a standard delphi font select dialog... oh what a can of worms i opened! amongst other things, the font select dialog provided by delphi works, well, poorly at best. it looks like the defects are mostly in windows (the delphi dialog is just a wrapper for the win32 API). when i did get it going, i found that even though there are a few monospaced fonts, very few of them actually are. many are monospaced for most characters, but not all. also few have the top 128 characters filled out correctly (as in the CP437 link). i tried out all sorts of ways to work out a suitable 'cell size' to place characters in, with no real success. so it looks like "Terminal" is the only sensible option. as an interim measure i'll look at adding a hidden option to change the hardcoded font and cell dimensions for you to experiment with. cheers, rob :-) |
||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 586 |
Rob found a way to use a replacement font for the Terminal font. Registry Keys I did it a bit different in the replacement font part I found a Japanese font I didn't need and changed the name to Terminal and them Modified the data to Ubuntu Mono. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Quazee137 |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2409 |
think i might have created a semi-useful solution for at least easily testing out different fonts - give this a try: 2017-11-23_223608_GFXterm_TEST.zip if you hold down the shift key while right-clicking to bring up the menu, there should be an extra option under 'font size' called 'manual'. here you can select any of your monospaced fonts. after selecting the font you'll be prompted for a cell size, you'll have to use trial and error here and check that a line of underscores (___) don't have gaps between them while none of the other characters overlap. finally, run the "GFX demo 2.bas" file to check out the rendering of the top 128 characters. if the codepage seems wrong, use a NEGATIVE value for the cell size to cause the character set to be forced to OEM and see what happens (in most cases this will trigger an unwanted font substitution, but not always). let me know how you go at finding usable fonts. i'm thinking that a file called (for example) GFXterm.txt could be used to hold a list of font parameters to use instead of the current options of 9/12/14pt. cheers, rob :-) |
||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 586 |
Here is a few screen shots of the test code. The font viewer check box FP when checked didnt see the font and GFXtern didn't see it. So I did the font replace in the reg and it works. Where does GFXterm test look for the fonts? I added it to my Linux fonts and to the wine fonts. ![]() ![]() ![]() ![]() ![]() ![]() And heres the font thats working.2017-11-24_222151_fourthreeseven-master.zip |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2409 |
the test version only showed monospaced fonts - my mistake. here is a slightly changed version (one byte different!) that should now show all fonts available to windows: 2017-11-24_232038_GFXterm_TESTB.zip GFXterm doesn't 'look for the fonts' as such in any specific place, all these test versions do is ask windows to pop up a font selector dialog - the dialog itself with the list of fonts is entirely generated by windows. when you click on 'ok' the dialog closes and returns to GFXterm the details of the font you selected: name, size, character set (script). the name + size + charset are then set in the font field of various visual objects (the text layer is an object, as is the cursor, and so is the 'select and copy' view). when GFXterm tells one of these objects to print or display something the font information for the object is passed to windows to do the actual printing. does this make any sense? it is kind of an odd way of thinking about things that is hard to get one's head around. the bottom line is that GFXterm has rather limited control over what is going on! an extra complication is that if you select a font that windows thinks is unsuitable, then it will quietly substitute another font. but there seems to be no way to tell when windows has done this, or what other font is substituted in, it is all quite invisible to the application. addendum: the "FP only" checkbox sets a flag that tells the font selector dialog to only show monospaced fonts. i think that by definition truetype fonts are not classed as monospaced. cheers, rob :-) |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2409 |
more progress, resulting in another test release, this one now saves the font selection between runs: 2017-11-27_215106_GFXterm_TESTC.zip i've found a good FREE font to use is "DejaVu Sans Mono", available here: https://dejavu-fonts.github.io/ i've been testing with 14 point, giving a screen size of 880 x 528 pixels (11x22 pixels per character). as before, hold down shift while right-clicking to bring up the menu. select font size -> manual, select the font, but now enter either "0" or "-0" for the font width to try to automatically calculate the cell size. "-0" is preferable, as it also forces the character set to OEM. once a manual font selection has been made, the 'manual' menu option will continue to be available until one of the 9/12/14pt menu options are made. proportional fonts are now handled by centering them in the cell and filling the whole cell area with the background colour before printing the character on the screen. grogster and quazee137: are you able to give this a good exercising in both windows and linux? if there are no bugs it will become the next release in the other GFXterm thread. cheers, rob :-) |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4006 |
Rob, Under Linux with WINE the wider chars overwrite the one(s) to left/right. (Maybe they're all doing it but it's only obvious then.) Oh - I tried 12pt & 14pt and both did it. No need to hold shift when right-clicking to choose the font. John |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2409 |
john: that is right, under wine the characters overlap. this is because normally GFXterm is hard-coded to use a monospaced font called "Terminal" that is included with all versions of windows. linux generally lacks this font, and wine (rather recklessly) goes and silently substitutes a proportional font that produces the mess you observe. this is why i've added a feature especially for linux users: holding down shift while right-clicking to bring up the menu unlocks an extra menu option 'font size -> manual'. this option will allow the linux/wine user to select an alternative (monospaced) font to use in place of the hard-coded "Terminal" at 9/12/14pt. the extra menu option then remains unlocked until 9/12/14pt "Terminal" is selected. i'd envisage very few linux users wanting to use GFXterm, as linux already has many fine terminal emulators. hence the use of a normally hidden menu item to provide a fix for those few who need/want it. are you saying that under win 'font size -> manual' is always visible in the menu, even when one of 9/12/14pt is checked? that would be odd behaviour. cheers, rob :-) |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4006 |
Oh - sorry! - I do need the shift to get that. (And yes one of the well-known terminal emulators would probably be used.) John |
||||
Quazee137![]() Guru ![]() Joined: 07/08/2016 Location: United StatesPosts: 586 |
Rob the DejaVuSansMono works. Are you going to use the DejaVuSansMono in place of the Terminal font so it just works, no need to edit the wine reg? Even with all the other terminal packages for linux this makes for very easy buffer paste code testing. No xmodem or setting up ASCII transfer timmings as in a few other terminal packages. I like the buffer paste for sending the OPTIONS to a Micromite. I have five sets in a file and can just copy and paste the one I need. Lazy me! This does save on typing. I think its a great tool for any OS working with MMBasic and all the MIGHTY Mcromites that are and will be. Thanks Rob Quazee137 |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |