Voljega / BestArcade

Tool for generating arcade romsets
85 stars 9 forks source link

Window and font size issue on MacOS #1

Open kleingeld1 opened 4 years ago

kleingeld1 commented 4 years ago

Hi, I tried creating a fbneo set. I tried both with fbn as input only and with fbn and mame2003. The resulting fbn output is empty (csv, dat etc files are there, but no roms). When I use mame as input, the mame output is filled. I used fbn as preferred set.

I am on macOS, but the app runs fine when started from terminal.

What additional info can I provide to analyse the issue?

kleingeld1 commented 4 years ago

I just tried it again after manually editing the retroarch.conf instead of putting the paths in the GUI - and this time it worked. I don't really know why

Voljega commented 4 years ago

Hello @kleingeld1 and thank you for testing; especially on Mac

That's very strange, especially given that the csvs and dats are still generated, this looks exactly like you'd have used Dry Run to generate only these data, but that doesn't seem to be the case ?

I assume you saw no error in the GUI, nor in the terminal ? (some exceptions can be displayed only in the terminal)

What you can provide if you manage to reproduce the issue :

I assumed you launched directly BestArcade.py file from the terminal using python ?

kleingeld1 commented 4 years ago

Hi @Voljega, I didn't manage to reproduce the error, so unfortunately I can't really help.

But another feedback from testing on macOS that I can give: the window doesn't fit on the screen of my MacBook Air, the console / log part at the bottom is cut off.

To your last question: yes, I start from terminal "python3 BestArcade.py"

I have one more question, I am seeing a lot of these messages, but don't really understand what they mean:

<--------- Detecting errors -----------> Loading Output Tests Found 1210 fbneo tests WORKING 100.00 % MOSTLY WORKING 0.00 % BADLY WORKING 0.00 % NON WORKING 0.00 % UNTESTED 0.00 % Found 90 mame2003 tests WORKING 100.00 % MOSTLY WORKING 0.00 % BADLY WORKING 0.00 % NON WORKING 0.00 % UNTESTED 0.00 % Found 1300 unique tests Possible errors ERROR 64street should be exported for mame2003 ERROR avsp should be exported for mame2003 ERROR armwar should be exported for mame2003 ERROR asterix should be exported for mame2003 ... (there are a lot more lines like these)

Voljega commented 4 years ago

Hello,

It means your mame2003 romset is likely missing a lot of roms, check in your original mame2003 romset, 64street.zip, avsp.zip , armwar.zip etc should be missing.

It's not normal, you do not have a complete mame2003 romset.

For the window, I guess your resolution is inferior to 1080p ? Unfortunately I don't handle lower resolution yet but I will add it to my potential list of fixes ;)

kleingeld1 commented 4 years ago

That's weird, I do have the MAME2003 Reference Set MAME0.78 -- but maybe I need to double check it.

My resolution actually is 2560 x 1600 -- could it be related to the retina display and how the GUI is scaled?

Voljega commented 4 years ago

Hmmm I'm not sure then, maybe, can do you a screen capture of the whole screen for me to see how it looks like ?

kleingeld1 commented 4 years ago

sure!

Screenshot 2020-06-07 at 17 32 04
Voljega commented 4 years ago

Yes then it seems to be a scaling issue everything appears x2 compared to the size on my w7 in 1080p And i just looked in the code and I don't enforce any size anywhere

Try to edit gui.py file and just after line 12 self.window = Tk.Tk() add on next line : self.window.geometry("930x950")

Take care to indentation it should be aligned :

class GUI():    

    def __init__(self,scriptDir,logger,title) :        
        self.scriptDir = scriptDir
        self.window = Tk.Tk()
        self.window.geometry("930x950")
        self.window.resizable(False,False)
        if platform.system() == 'Windows' :
            self.window.iconbitmap('bestarcade.ico')
        self.window.title(title)        
        self.logger = logger  

Tell me if it fixes the issue, if yes, I will include the fix in next release

kleingeld1 commented 4 years ago

it actually broke the window some more

Screenshot 2020-06-07 at 17 47 11
Voljega commented 4 years ago

Hmmmm then yes it seems like a scaling issue on mac .... will try to see what I can do

Voljega commented 4 years ago

ok replace the line you just added bye self.window.tk.call('tk','scaling',0.5) and tell me if it's better

kleingeld1 commented 4 years ago

nope, looks like before (without the added line)

Voljega commented 4 years ago

Well it works on Windows and actually seems to be a Tkinter (the UI framework I use) bug on MacOS :s There doesn't seem to be much I can do without very heavy rework of the whole UI and I am not too keen on that....

Will see if I can manage to find another solution

Voljega commented 4 years ago

In the meantime did you manage to check your mame2003 romset ?

kleingeld1 commented 4 years ago

I just cheked the first 4 and all roms are there. Also, they are in the fbnset and were taken from there -- which is as intended, cause I set fbn as my prefered set.

Voljega commented 4 years ago

OK no problem for that then, just my error detecting function is a bit too severe !

Voljega commented 4 years ago

Hello @kleingeld1

Can you try this solution : modify the beginning of the gui.py file with this

# -*- coding: utf-8 -*-

import tkinter as Tk
import tkinter.font as Font
from retroarchgui import RetroarchGUI
from customgui import CustomGUI
import platform

FONT_SIZE = 8

class GUI():    

    def __init__(self,scriptDir,logger,title) :        
        self.scriptDir = scriptDir

        self.window = Tk.Tk()
        self.window.resizable(False,False)

        default_font = Font.nametofont("TkDefaultFont")
        default_font.configure(size=FONT_SIZE)
        text_font = Font.nametofont("TkTextFont")
        text_font.configure(size=FONT_SIZE)
        fixed_font = Font.nametofont("TkFixedFont")
        fixed_font.configure(size=FONT_SIZE)

        if platform.system() == 'Windows' :
            self.window.iconbitmap('bestarcade.ico')
        self.window.title(title)        
        self.logger = logger

and see if it works, if it still too big try reducing FONT_SIZE value to something lower like 6 or 4 and see if it has any effect

if it works, tell me what value was good for you

Voljega commented 4 years ago

Tested on my work mac, it works, although I don't have exactly the same display result as you, so I will need to add the font size parameter in configuration somewhere, will think about how to do that

Voljega commented 4 years ago

@kleingeld1 even simpler just update your local code with git pull

kleingeld1 commented 4 years ago

Hi, sorry, it took me forever to get back and try this. What is working is that it fits on screen. However, the UI and the font are scaled together, which results in a tiny, almost unreadable font size. I attached a few screenshots at different scaling levels for reference. The first scaling level would work if the font was bigger.

Screenshot 2020-06-20 at 11 03 53 Screenshot 2020-06-20 at 11 04 11 Screenshot 2020-06-20 at 11 04 28
Voljega commented 4 years ago

@kleingeld1 actually the whole issue only comes from the size of the font on MacOS , I don't scale UI elements at all, only the fonts, and UI elements scale automatically

Seems the graphical library tkinter has a lot of issues on MacOS (for example on your screen deactived elements like ComboBox cntent next to Gun prefered set is not greyed out)

I even retested this fix on my MacBookPro from work with latest MacOS, and I don't have the same results as you :

What kind of Mac and do you use and what OS version ? Because I also noticed your resolution (or how your OS renders it) seems pretty low, like in the Menu Bar with Python / File / Edit /etc the font is really big compared to my MacBookPro. Same for the window title 'BestArcade 1.5', it's really big especially compare to the font inside BestArcade tool window

So we might have to take other elements in consideration like dpi of the screen or something...

Don't worry though we are not in a hurry, we can take all of our time as the next version will be released soon, so take your time for responses and everything, no problem :)