On 11 June 2015 at 17:57, Jim Dishaw <j...@dishaw.org> wrote: > >> On Jun 11, 2015, at 4:06 AM, Phil Rosenberg <p.d.rosenb...@gmail.com> wrote: >> >> Hi Jim >> The documentation states that the provided text height will be in mm. >> The user can set dpi with plspage so you should use the PLStream->xdpi >> and PLStream->ydpi to size your text in pixels. In case the user >> hasn't set this you should use a sensible default. Of course the >> actual value will depend on the monitor, but rather than try to grab >> this it seems that there are two standards and for consistency you >> should use one of these. One is to use 72 pixels per inch so that 1 >> pixel = 1 pt. The other is 90 pixels per inch which seems to be the >> default for most svg renderers. For wxWidgets I chose 90 pixels per >> inch. I also noticed tect seems a little smaller than the example >> online (from the cairo driver?) but it does as described in the >> documentation so I am happy with that. >
> > The recommendation in the Windows API is to use GetDeviceCaps () with the > >LOGPIXELSX/LOGPIXELSY values to get the dpi setting. Right now I’m > >ignoring the DPI setting provided by the user. On native text rendering > devices >the xdpi/ydpi settings are essentially being used to scale the size > of fonts, >which (IMHO) abuses the meaning of “DPI”. > Yes as you say the windows API provides this mechanism - in fact there is something about if you wish to have your app in the windows store you must do this so your app can work on phones/tablets/pcs or something. Not sure of the details. For The windows interactive device it is perhaps not a big deal - for wxWidgets the user can pass in a paint dc or a memory dc so in the latter case it is down to the user to specify a DPI. Because all DCs are treated equal it is up to the user in all instances. Re DPI basically being a text scaling parameter - well you are correct - but does any other function receive arguments in mm/inches or is text the only one? > Which size are you referring to? When the window is resized, the driver gets > >the new dimensions of the client area (via GetClientRect() for displays and > >GetDeviceCaps() for printers). It uses the new size to calculate the new > >scaling between device virtual coordinates (PIXELS_X/PIXELS_Y in PLplot) > >and the new output device coordinates, The dpi remains consistent with what > >Windows reports. > So for wxWidgets if I resize the window to double the size, the text stays the same size. I.e. I maintain the same dpi and text height in mm when the window is resized. Phil ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel