Calculate Line Height
Calculate Line Height
Is there a possibility to calculate the estimated line height before a TRichViewEdit will be filled with data (pure text, no tables, images aso)?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
You can measure a height of a text item by applying its font to some canvas, then calling Canvas.TextHeight.
To apply a style, call
RVStyle.ApplyStyle(Canvas, StyleNo, rvbdUnspecified, False, True, nil, False, False), where StyleNo = RichViewEdit.GetItemStyle(ItemNo), where ItemNo is an index of the text item.
To apply a style, call
RVStyle.ApplyStyle(Canvas, StyleNo, rvbdUnspecified, False, True, nil, False, False), where StyleNo = RichViewEdit.GetItemStyle(ItemNo), where ItemNo is an index of the text item.