Comments (17)
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?
from openscad.
Yep, here are the registry contents when OpenSCAD was loaded:
REGEDIT4
[HKEY_CURRENT_USER\Software\OpenSCAD]
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD]
"recentFileList"=hex(7):5a,3a,2f,6d,65,64,69,61,2f,63,6f,64,65,2f,6f,70,65,6e,
73,63,61,64,2d,6d,61,73,74,65,72,2f,74,65,73,74,32,2e,73,63,61,64,00,00
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\view]
"orthogonalProjection"="false"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window]
"position"="@point(67 55)"
"size"="@SiZe(800 600)"
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes]
"size"=dword:00000002
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes\1]
"entry"=dword:0000018e
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter1sizes\2]
"entry"=dword:0000018e
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes]
"size"=dword:00000002
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes\1]
"entry"=dword:00000175
[HKEY_CURRENT_USER\Software\OpenSCAD\OpenSCAD\window\splitter2sizes\2]
"entry"=dword:000000bb
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]
fontsize=0
[view]
orthogonalProjection=false
[window]
size=@SiZe(800 600)
position=@point(0 24)
splitter1sizes\1\entry=397
splitter1sizes\2\entry=397
splitter1sizes\size=2
splitter2sizes\1\entry=381
splitter2sizes\2\entry=191
splitter2sizes\size=2
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:
- The specified font family is searched for.
- If not found, the styleHint() is used to select a replacement family.
- Each replacement font family is searched for.
- If none of these are found or there was no styleHint(), "helvetica" will be searched for.
- If "helvetica" isn't found Qt will try the lastResortFamily().
- If the lastResortFamily() isn't found Qt will try the lastResortFont() which will always return a name of some kind.
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?
from openscad.
On Dec 28, 2011, at 21:46 PM, Brad Pitcher wrote:
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:
It looks like we were inheriting the default font of QTextEdit.
I've committed a fix - it should work better now, but only tested on Mac.
-Marius
from openscad.
uh:
"Qt does not support style hints on X11 since this information is not provided by the window system."
I'm now forcing the font to fixed pitch, unless a concrete family is selected.
from openscad.
This didn't fix the issue for me. The default is still "Deja Vu Sans" in Ubuntu.
from openscad.
how can i tell which font its loading?
from openscad.
Go to Edit->Preferences and select the Editor tab
from openscad.
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.
from openscad.
I assume they all have "DejaVu Sans Mono" but we should be thinking about other distros too right?
from openscad.
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.
from openscad.
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.
from openscad.
I pulled the updates from openscad master and it works great mostly.
In Ubuntu, my default font was "Andale Mono"
In windows (wine) my default font was fixed pitch, but when I went to the preferences to see what font it was, it showed "MS Sans Serif" to be the font in use, which was definitely not true.
Any idea why it would show a different font from the font that is actually in use?
I wonder also if it's just a wine issue.
from openscad.
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
from openscad.
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.
from openscad.
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
from openscad.
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:
https://github.com/openscad/openscad/pull/58/files
from openscad.
Thanks Don, it looks good in Wine now. Default font for me was "Courier New", I wouldn't have guessed it was fixed pitch.
from openscad.
Related Issues (20)
- Selection of line thickness for SVG/PDF export HOT 1
- Unable to launch HOT 8
- More pdf formats
- NotManifold error in difference() example, but works in CGAL HOT 15
- Downgrade WARNING: PolySet -> Manifold conversion failed HOT 31
- Crash when rendering examples/Advanced/GEB.scad with Manifold HOT 7
- Automatically test all examples HOT 1
- Windows CI fails to build
- Disable hardware GPU acceleration HOT 6
- ERROR: The given mesh is not closed! HOT 1
- Customizer precision syntax causes default value to be changed HOT 1
- Functions as input for the scale parameter in linear_extrude
- Plan for next release HOT 2
- textmetrics does not work from command line HOT 3
- Render missing parts of the model HOT 4
- can not open dat file std:bad_alloc HOT 12
- 3DConnexion Bluetooth Wireless SpaceMouse
- example017 CGAL regression
- projection example CGAL regression
- can not open some *off file HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openscad.