Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Tk, fonts and resolution

by Chuma (Scribe)
on Dec 10, 2017 at 20:46 UTC ( [id://1205266]=note: print w/replies, xml ) Need Help??


in reply to Tk, fonts and resolution

I've tested all the fonts, and it seems that some are more broken than others; as far as I can tell, some look like proportional fonts that are just using a lower resolution, whereas others don't scale up at all, so large font sizes end up using "pixels" the size of peas.

As for other OSes, I haven't had a chance to test that – so far, I'm having enough trouble getting things to run on one system. But if anyone wants to try it on their system, this should be a working example:

use Tk; $mainWin=MainWindow->new; for(10,20,40,80,200){ $mainWin->fontCreate("font$_",-family =>'lucidabright',-size=> +$_); $mainWin->messageBox(-message=>"$_ The Quick Brown Fox Jumped +Over The Lazy Dog",-type=>'Ok',-font=>"font$_"); }

In this case, 'lucidabright' is an example of the bad kind of font, whereas 'utopia' is a similar-looking font of the less bad kind.

As I understand the discussion in the link, they're basically disabling the Retina thing to set the resolution higher. That would probably more or less solve the problem, although it would be a little inconvenient to have to change the resolution every time I run the program. I suppose there's some system command for doing that, too. Bit of a workaround, and of course the guy who says his screen died also doesn't inspire confidence. But I'll look into that.

Someone else had similar problems in this thread. They didn't find any solution, and the OP says they eventually gave up using text and replaced it with pre-rendered images, but I'm hoping I won't have to do that.

I also tried getting the modules "Img" and "tkpng", hoping they might help with the PNG issue, but frankly I can't figure out how to install them. One is a long list of "dylib" files, the other is the usual Unix mess with "configure" and "makefile", but running "make" gives fatal error: 'X11/Xlib.h' file not found, so I'm stumped again. I'm not very good at all that unix hacking. I'm a Mac user, I just want to click an app...

Replies are listed 'Best First'.
Re^2: Tk, fonts and resolution
by Anonymous Monk on Dec 12, 2017 at 01:55 UTC

    That code doesn't run :/ bad option "-font": must be -default, -icon, -message, -parent, -title, or -type

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1205266]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found