Thank you. That helps a lot. Milind
On Wed, Mar 25, 2020, 5:49 AM Antonio Scuri <antonio.sc...@gmail.com> wrote: > Yes, but as I said, it depends on the application. Some applications > define the size of the text and then the lines must align to it. > > If yours the text must align to the lines, then yes, you should use font > sizes in pixels. To use font sizes in pixel you can specify negative values > in cd.CanvasFont. > > To manually convert points to pixels you can use > > canvas:MM2Pixel(mm_dx, mm_dy) > > I tested this, on your sample and returns ok: > > print(cdbCanvas:MM2Pixel(12/cd.MM2PT, 12/cd.MM2PT )) > 32.0 32.0 > > Best, > Scuri > > > > > > > Em ter., 24 de mar. de 2020 às 20:49, Milind Gupta <milind.gu...@gmail.com> > escreveu: > >> Yes this one does not have scaling because I was just doing an example to >> check proportionality. >> >> So what I understand is to be consistent across different canvases where >> pixels/mm are different I should internally store the size of text I >> display in pixels? That way when I implement scaling it would be on pixels >> and remain consistent. >> >> But when I tried to convert the pt size to pixels I am not having good >> results. >> >> For example to convert 12 pts to pixels I did this: >> >> cd.MM2Pixel(12/cd.MM2PT, 12/cd.MM2PT ) >> >> But this returns 0. How do I translate this? >> >> On Tue, Mar 24, 2020 at 12:48 PM Antonio Scuri <antonio.sc...@gmail.com> >> wrote: >> >>> Hi, >>> >>> That sample has no scaling. I least I couldn't find any. >>> >>> I run it and print it. Yes the text looks larger because it is using >>> the default font which is specified in points, not in pixels. >>> >>> Best, >>> Scuri >>> >>> >>> Em ter., 24 de mar. de 2020 às 16:42, Milind Gupta < >>> milind.gu...@gmail.com> escreveu: >>> >>>> For example the screen shows the graphic as: >>>> >>>> [image: image.png] >>>> >>>> While the printout shows it like: >>>> [image: image.png] >>>> The text gets totally out of proportion to the rest of the drawing >>>> compared to the screen for the same size. >>>> >>>> On Tue, Mar 24, 2020 at 12:38 PM Milind Gupta <milind.gu...@gmail.com> >>>> wrote: >>>> >>>>> Actually the problem is the scaling is not the same on the screen >>>>> compared to the printer. So the issue is if I scale the drawing and the >>>>> text proportionally to fir the number of pixels the text gets much more >>>>> larger. >>>>> To understand that if you just run the script and see how it >>>>> looks on the screen compared to on the printer you can see that the >>>>> scaling >>>>> of the text and the graphics is not proportional. The text ends up much >>>>> larger in printer than on the screen. >>>>> >>>>> On Tue, Mar 24, 2020 at 12:29 PM Antonio Scuri < >>>>> antonio.sc...@gmail.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> That's expected. The PDF or printer canvases have a resolution much >>>>>> higher than the screen. I mean there are much more pixels in the canvas. >>>>>> So >>>>>> things get smaller on output if not properly scaled, text also. The >>>>>> approach depends on the application. >>>>>> >>>>>> Notice that applications are starting to have the same problem on >>>>>> screen when the user has a 4k monitor. By default Windows will scale all >>>>>> the application output. In the IUP documentation we explain how to avoid >>>>>> that automatic scale, but the the application should be able to display >>>>>> its >>>>>> interface in a high resolution. >>>>>> >>>>>> Best, >>>>>> Scuri >>>>>> >>>>>> >>>>>> Em ter., 24 de mar. de 2020 às 05:38, Milind Gupta < >>>>>> milind.gu...@gmail.com> escreveu: >>>>>> >>>>>>> Hi Antonio, >>>>>>> When I use cd.PRINTER canvas to print the text scaling is >>>>>>> not coming out right. For example see the the attached file. When I >>>>>>> press >>>>>>> the button and press print the drawing shows up in the lower left >>>>>>> corner as >>>>>>> expected but the text is quite out of proportion. I am doing this on >>>>>>> windows. It doesn't matter if I use an actual printer or use the Adobe >>>>>>> PDF >>>>>>> printer (output attached) the result is the same. >>>>>>> How can I fix the text scaling to be right? >>>>>>> >>>>>>> Thanks, >>>>>>> Milind >>>>>>> _______________________________________________ >>>>>>> Canvasdraw-users mailing list >>>>>>> canvasdraw-us...@lists.sourceforge.net >>>>>>> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >>>>>>> >>>>>> _______________________________________________ >>>>>> Canvasdraw-users mailing list >>>>>> canvasdraw-us...@lists.sourceforge.net >>>>>> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >>>>>> >>>>> _______________________________________________ >>>> Iup-users mailing list >>>> Iup-users@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/iup-users >>>> >>> _______________________________________________ >>> Canvasdraw-users mailing list >>> canvasdraw-us...@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/canvasdraw-users >>> >> _______________________________________________ >> Iup-users mailing list >> Iup-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/iup-users >> > _______________________________________________ > Iup-users mailing list > Iup-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/iup-users >
_______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users