Thanks vovchik, it seems hideously complicated to do this accurately (I've just read a four page post here http://basic-converter.proboards.com/in ... 314&page=2 that several PL forum members have posted in).
In a language that offered a simple getpixel() function (or the address of the window's buffer!) I'd take the ultra-crude/pragmatic route and blit a white 'W' or 'M' on a black background, get the white pixel with the maximum x value and use that as the character width. Unfortunately that's not an appropriate technique in this case. It might be better to build a few different versions of the program for use on systems with differing dpi settings instead!
Paul
Psearch - Puppy web search utility
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
HUG
Do not know why. I only know that it has given the good result.linuxcbon wrote:Why 66 ?L18L wrote:I have inserted HUGOPTIONS("BASEXFTDPI 66") and compiled. See the result, your original and mine
So did I by using 66.Posted on 29 Mar 2013, 8:06 by BarryK wrote: re hug dpi
L18L,
I don't see any problem.
I solved that problem a long time ago:
http://bkhome.org/bacon/hug/layout.htm
Both /usr/share/doc/welcome1stboot.bac and /usr/local/simple_network_setup/proxy-setup.bac in Woof use that method.
And don't know why because PaulR has used 78.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: HUG
seaside
thanks for your assistance
The problem
why 66 if PaulR has 78
solved
http://bkhome.org/bacon/hug/layout.htm
Applying that hint:
Everything is fine now.
Our thanks go to ...
PuppyMaster BarryK
thanks for your assistance
The problem
why 66 if PaulR has 78
solved
Shame on all of us except BarryKL18L wrote:Do not know why. I only know that it has given the good result.linuxcbon wrote:Why 66 ?L18L wrote:I have inserted HUGOPTIONS("BASEXFTDPI 66") and compiled. See the result, your original and mine
So did I by using 66.Posted on 29 Mar 2013, 8:06 by BarryK wrote: re hug dpi
L18L,
I don't see any problem.
I solved that problem a long time ago:
http://bkhome.org/bacon/hug/layout.htm
Both /usr/share/doc/welcome1stboot.bac and /usr/local/simple_network_setup/proxy-setup.bac in Woof use that method.
And don't know why because PaulR has used 78.
quoted fromwho wrote:The same thing as shown above could also happen if a different GTK theme with larger font is chosen (see menu Desktop -> GTK theme chooser). Different users are going to have their own theme preference, but it isn't so good if a theme has bigger font sizes which cause our example window to be messed up.
There is also a simple solution to this. Peter introduced a feature that allows a font to be specified in the program, that overrides the GTK default. This will apply to all widgets. Put this near the beginning of the program:
HUGOPTIONS("FONT DejaVu Sans 12")
...with whatever font you want. DejaVu Sans is available in all puppies.
http://bkhome.org/bacon/hug/layout.htm
Applying that hint:
Code: Select all
HUGOPTIONS("BASEXFTDPI 78")
'set font size so
'windows/fonts will scale properly on other systems
HUGOPTIONS("FONT DejaVu Sans 9")
Our thanks go to ...
PuppyMaster BarryK
- Attachments
-
- psearch_solved.png
- (15.96 KiB) Downloaded 1011 times
Thank you L18L, I haven't had much chance to think about this over the last few days as I've been working on some other projects. I missed that on Barry's page too - doh!
I've recompiled and attached the program, source and pot file.
Cheers
Paul
I've recompiled and attached the program, source and pot file.
Cheers
Paul
- Attachments
-
- psearch1-1.tar.gz
- (114.17 KiB) Downloaded 409 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Psearch - Puppy web search utility
PaulR
packaged just to help you on the Puppy way:
for next version (how I would do it):
cp .pet to .tgz
expand .tgz to /mnt/home/bacon
copy xxx-1.2 xxx-1.3
cd xxx-1.3
edit version, ...
maybe: define location of file psearch.sites? -> $HOME
compile .......
dir2pet xxx-1.3
Who needs which package?
dev: psearch_DEV
english user: psearch
other user: psearch and psearch_NLS
translator: psearch and psearch_DEV
please move the 3 packages to 1st post of this thread
where everybody will expect them to be.
Have fun.
-------
edited later
I have copied only your file to version 1.2
but did not change version number in the source.
packaged just to help you on the Puppy way:
for next version (how I would do it):
cp .pet to .tgz
expand .tgz to /mnt/home/bacon
copy xxx-1.2 xxx-1.3
cd xxx-1.3
edit version, ...
maybe: define location of file psearch.sites? -> $HOME
compile .......
dir2pet xxx-1.3
Who needs which package?
dev: psearch_DEV
english user: psearch
other user: psearch and psearch_NLS
translator: psearch and psearch_DEV
please move the 3 packages to 1st post of this thread
where everybody will expect them to be.
Have fun.
-------
edited later
I have copied only your file to version 1.2
but did not change version number in the source.
- Attachments
-
- psearch-1.2.pet
- (40.47 KiB) Downloaded 413 times
-
- psearch-1.2_NLS.pet
- for non-english users
at the moment german only - (1.02 KiB) Downloaded 397 times
-
- psearch-1.2_DEV.pet
- for toranslators
- (4.03 KiB) Downloaded 369 times