I’m using a label and drawInto in a canvas to export my PNG files. Everything is working except the line height is different from what i would expect. Even though I have an identical canvas and label in the user interface, the canvas I’m using for the Picture export is putting more space between lines and bumping the text off the bottom of the label. All basic settings for both the canvas and the label are exactly the same and the canvas and label for the export is using the same settings as the one in the user interface. I couldn’t find a way to control the line height in the LR and I don’t know why it would be different.
canvas3 is the export canvas. captionLabel is the one in the user interface and captionLabel1 is the one used for the export in canavas3:
i tried setting captionLabel1.TextUnit = FontUnits.Pixel but it made the text a lot smaller when it exported. Both were set to pixels.
All other settings are exact as to the interface, in fact it accesses its properties.
Are you seeing this on TargetWindows, TargetMacOS, TargetLinux - or all of them?
My suspiction (*) is that you are seeing this on Windows… And if this really is about Windows… then read this post.
Be aware that the Label (a Control) is being GDI (compatible) rendered.
captionLabel1.DrawInto(p.Graphics
So this question is: how did you create the p which you’re drawing into? Is p.Graphics a GDI rendering context, or a Direct2D rendering context?
Try to draw into a Picture with GDI rendering: New Picture(width,height,32)Note: the 3rd param is what makes the difference - again: read the other post. For HiDPI/Retina support, set then the Picture’s .ScaleX/Y appropriately. What happens if you then .DrawInto a Picture created like this (GDI)? It should render the same as the Label.
(*) In your attached Picture, the Text above looks “crisp” (GDI), the Text below looks “blurry” (Direct2D). Seems like a different rendering-type, e.g. differences in character-widths. So that’s why this is my suspiction.
Dim p As New Picture(app.backgroundWidth, app.backgroundHeight)
The text in the image below is being added to a movie and therefore loses some quality when the new movie is rendered. Probably also why there is a difference in the background color. More worried about the line spacing right now though.