-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default font should be mono #49
Comments
We are requesting a Typewriter font, which should prefer a fixed pitch font, also on Windows: https://github.com/openscad/openscad/blob/master/src/mainwin.cc#L1800 Are you sure the font isn't overridden in the preferences? |
Yep, here are the registry contents when OpenSCAD was loaded: [HKEY_CURRENT_USER\Software\OpenSCAD] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\view] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes\1] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes\2] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes\1] [HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes\2] To test the Ubuntu native version I deleted ~/.config/OpenSCAD/OpenSCAD.conf to start from defaults and the initial font was "DejaVu Sans" My config file contains the following: [editor] [view] [window] So it seams that QT isn't doing the job correctly? According to http://doc.trolltech.com/4.6/qfont.html#fontmatching the font matching algorithm is:
Not sure where it's failing in there. My system doesn't have Helvetica, so for all I know it could be getting to the very last step and choosing the lastResortFamily. Any ideas how I can test further? Is there a list somewhere of fonts that classify as "Typewriter" fonts? |
On Dec 28, 2011, at 21:46 PM, Brad Pitcher wrote:
It looks like we were inheriting the default font of QTextEdit. -Marius |
uh: I'm now forcing the font to fixed pitch, unless a concrete family is selected. |
This didn't fix the issue for me. The default is still "Deja Vu Sans" in Ubuntu. |
how can i tell which font its loading? |
Go to Edit->Preferences and select the Editor tab |
d'oh.. thanks. is there a fixed-width font that all ubuntu versions have? i can try to do some testing but dont know much about fonts. |
I assume they all have "DejaVu Sans Mono" but we should be thinking about other distros too right? |
oh... good point.. . . . thanks for the info. my brain is fried at the moment. i will try to make a patch in a few days. |
Here is an experimental patch to fix the bug reported. It chooses a specific substring for a font name depending on the OS. On linux, it looks for anything with the word 'Mono' in the name On Windows, it looks for anything with the word 'Console' in the name On Mac it looks for anything named 'Monaco' in the name. it doesn't use SetFont in mainwin.cc, because that gets overridden anyways by Preferences.cc constructor and Preferences.cc updategui. Even if there are no preferences set, and there is no .config file in existence, the Preferences code pulls the default font from the OS, regardless of SetFont in mainwin.cc. |
I pulled the updates from openscad master and it works great mostly. |
d'oh i think the problem might be that it's looking for "Console" named fonts in Wine because it thinks it's Windows. Wine though uses the Linux fonts, so Console won't be there... so i have no idea what it's doing. Do you know where it stores the OpenSCAD.conf file in Wine? If I can figure out how to erase that and restart in Wine i think i can track it down and fix this bug. scratch that, i found it,,, its in the registry (!) . will debug tonight. thanks |
Yeah, it stores the openscad configuration in the registry: [HKEY_CURRENT_USER\Software\OpenSCAD] I would think getting this to work with wine shouldn't be a high priority though, there's no reason for anyone to use it with wine. |
if my code breaks in wine it will probably break in windows some day. besides this wont take long. i found this really cool page here: http://www.codestyle.org/css/font-family/sampler-Monospace.shtml |
thanks very much for reporting this bug. it would have shown up on any system where the default attempt didnt match a system font (not just wine). it should be fixed in this patch: |
Thanks Don, it looks good in Wine now. Default font for me was "Courier New", I wouldn't have guessed it was fixed pitch. |
I opened up the windows build of openscad with wine for testing and noticed that the default font was "MS Sans Serif". I think the default font should be a mono font to enable the use of spaces for code alignment. Ex.
test_vector = [[0, 0, 0],
[0, 1, 1],
[1, 0, 0]];
This example will only look exactly aligned with a mono font. Is that a difficult problem to solve?
The text was updated successfully, but these errors were encountered: