I would like to know how to calculate the height of a given a font (with its properties, like size, weight, style...) in a Window Universal Application using Win2D.
I previously used a CanvasTextLayout
, but it requires a text to work, like in this line:
var ctl = new CanvasTextLayout(session, "Some text", new CanvasTextFormat(), constraintWidth, constraintHeight
);
In my case, I will NOT have a text because what I'm looking for is the height in which all the glyphs of a given font (with its style, size, weight...) are fit.
EDIT: I have also tried with the CanvasFontFace
class, but it seems it doesn't have any public constructor.
LineSpacing
like in WPF. You will have to draw the text first. This is a limitation of Win2D. – Hobgoblin