diff --git a/comp/src/gb.report/.src/ReportField.class b/comp/src/gb.report/.src/ReportField.class index fae81e72f..86534ec17 100644 --- a/comp/src/gb.report/.src/ReportField.class +++ b/comp/src/gb.report/.src/ReportField.class @@ -67,9 +67,9 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As 'if the size choosed by the user is less than the font height, set the object to the font height - hext = Paint.TextExtents($sTmpText) - fTextHeight = MRTools.PixelsToUnits(hext.Height) - fTextWidth = MRTools.PixelsToUnits(hext.Width) + 'hext = Paint.TextExtents($sTmpText) + fTextHeight = MRTools.PixelsToUnits(Me.Font.Height($sTmpText)) 'hext.Height) + fTextWidth = MRTools.PixelsToUnits(Me.Font.Width($sTmpText)) 'hext.Width) If hMyHints.Height < fTextHeight Then hMyHints.Height = fTextHeight + (2 * Me._Padding) If Me._RelativeHeight Then hMyHints.Height = TotalHeight * Me._Height / 100 diff --git a/comp/src/gb.report/.src/ReportLabel.class b/comp/src/gb.report/.src/ReportLabel.class index 7563d47c2..b9b46100f 100644 --- a/comp/src/gb.report/.src/ReportLabel.class +++ b/comp/src/gb.report/.src/ReportLabel.class @@ -55,9 +55,10 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As 'draw.Font.size = draw.Font.size '* MRTools.ResolutionAffichage 'if the size choosed by the user is less than the font height, set the object to the font height - hext = Paint.TextExtents($sText) - fTextHeight = MRTools.PixelsToUnits(hext.Height + 4) - fTextWidth = MRTools.PixelsToUnits(hext.Width) + + 'hext = Paint.TextExtents($sText) + fTextHeight = MRTools.PixelsToUnits(Me.Font.Height($sText)) + fTextWidth = MRTools.PixelsToUnits(Me.Font.Width($sText)) If hMyHints.Height < fTextHeight Then hMyHints.Height = fTextHeight + (2 * Me._Padding) diff --git a/comp/src/gb.report/.src/ReportSpecialField.class b/comp/src/gb.report/.src/ReportSpecialField.class index 500ff7e18..307bebf28 100644 --- a/comp/src/gb.report/.src/ReportSpecialField.class +++ b/comp/src/gb.report/.src/ReportSpecialField.class @@ -55,9 +55,9 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As 'draw.Font.size = draw.Font.size '* MRTools.ResolutionAffichage 'if the size choosed by the user is less than the font height, set the object to the font height - hext = Paint.TextExtents($sText) - fTextHeight = MRTools.PixelsToUnits(hext.Height) - fTextWidth = MRTools.PixelsToUnits(hext.Width) + 'hext = Paint.TextExtents($sText) + fTextHeight = MRTools.PixelsToUnits(Me.Font.Height($sText)) 'hext.Height) + fTextWidth = MRTools.PixelsToUnits(Me.Font.Width($sText)) 'hext.Width) If hMyHints.Height < fTextHeight Then hMyHints.Height = fTextHeight + (2 * Me._Padding) If Me._RelativeHeight Then hMyHints.Height = TotalHeight * Me._Height / 100 diff --git a/comp/src/gb.report/.src/ReportTextLabel.class b/comp/src/gb.report/.src/ReportTextLabel.class index ac2caaf16..5069707b6 100644 --- a/comp/src/gb.report/.src/ReportTextLabel.class +++ b/comp/src/gb.report/.src/ReportTextLabel.class @@ -60,7 +60,7 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As hMyHints.Height = Me._Height + (2 * Me._Padding) - If Not IsNull(Me.Font) Then draw.Font = Me.Font + If Not IsNull(Me.Font) Then Paint.Font = Me.Font draw.Font.size = draw.Font.size If Me._Width = 0 Then @@ -72,7 +72,7 @@ Public Sub _GetSizeHints(AvailableW As Float, AvailableH As Float, TotalWidth As If Me._RelativeWidth Then hMyHints.Width = TotalWidth * Me._Width / 100 If hMyHints.Width > AvailableW Then hMyHints.Width = AvailableW - fTextHeight = MRTools.PixelsToUnits(draw.RichTextHeight($sText, MRTools.UnitsToPixels(hMyHints.Width))) + fTextHeight = MRTools.PixelsToUnits(Paint.RichTextHeight($sText, MRTools.UnitsToPixels(hMyHints.Width))) If hMyHints.Height < fTextHeight Then hMyHints.Height = fTextHeight + (2 * Me._Padding)