Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / DBP - File / Color / Font selectors

Author
Message
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 26th Oct 2011 15:43 Edited at: 29th Oct 2011 17:06
Another small plugin that gives you the standard win32 FILE selector, COLOR selector and a FONT selector.

As usual, the .dll file goes into your compiler/plugins-user folder.
And the .ini file goes into your editor/keywords folder.

This plugin took a long time in the creation and had a few bugs to iron out but with the brilliant help from IanM looking over my code and Resourceful for creating the first documentation for it, oh and the kick up the backside to get it working from a few people, I finally got it done.

The docs: (also in the attached download)



There\'s two things I am aware of that I need to do:

1. Create a Save / Load separate dialogues
2. Work out the formula to convert the fonts height into pixels for DBP to use properly. (fixed)

As again I hope this comes in handy. And I doubt that I will ever get round to working with a GUI system for DBP after the trouble I had with this, but then again, there\'s lots of very good GUI already out there...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Attachments

Login to view attachments
Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 29th Oct 2011 14:19
If you crack the formula for font size to pixel height, could you post it here, even if you haven't as yet incorporated it into the plugin? I've bombed at that a few times. Seems to relate strictly to the resolution of the display, not the dpi or actual physical size of the display. I'm starting to regard the DBP Set Text Size command as a sham. It is supposed to set a physical size in 'points' (1/72 inch). On monitors of different sizes set at the same resolution the text size appears proportional to the monitor size, which it should not.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 29th Oct 2011 17:09
The font height return value has now been fixed. Using DBP's SET FONT SIZE will now set the height correctly.

You may notice that the return value is different from what you select in the font selector, this is correct as it's the formula using the windows device context...

ie. Font selector will show 72 as the height, the return value will return 128. Setting the font size in DBP is correct using 128.

Hope this helps...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 30th Oct 2011 01:48 Edited at: 30th Oct 2011 01:48
EDIT: Some non - WYSIWIG fonts will display a different height. SOWWY... (Looking into it)

Darn it: double post

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 30th Oct 2011 15:23 Edited at: 30th Oct 2011 15:24
My concern is not the number a selector shows, but rather the physical size of what is thereafter displayed in text. I'm hoping to use this plugin to get around my string of failures in getting screen-displayed text messages to maintain a constant physical size across monitors of different physical vertical sizes (set at the same resolution). I.e., in windows when I set a font size in a word processing program, it prints at that size (in points) regardless of what printer I'm using. If Windows happens to know the vertical physical size of the current monitor, or dpi, or what we called "dot pitch" at one time (it certainly knows other things about the monitor), I supposed you could combine that info with the vertical pixel resolution to accurately force a specific number of vertical pixels to achieve the proper physical point size. I don't think DBP itself can do that.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 30th Oct 2011 20:55
I understand what you're saying. I've been playing around with the settings so that it will only show a certain list of usable fonts. The formula used to return the correct height gets the Device Context settings and works the height value from that. So I'm assuming that if the DBP window was on another monitor (with a different DPI setting) then it may give a different result but I don't know for sure.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 18th Nov 2011 04:14
hi WLGfx

I just found this post

the file selector has come a long way I see

I was glad to of help and I hope others will use it

I look forward to testing this out

Jeff Miller about the font size and screen size
perhaps using the point(x,y) command could be used for detecting ?

has any one created an example they could post of the command in use ?

if not I could give it a shot , it might take me a bit to create such

to move side ways - is to move forward
Since a Strait line gets thin fast

Login to post a reply

Server time is: 2024-04-18 19:56:20
Your offset time is: 2024-04-18 19:56:20