Exemplo n.º 1
0
 /// <summary>
 /// Create a standard font text without explicit rotation
 /// </summary>
 public Text(string text, Vector2 position, Vector2 bottomRight, Color color, Vector2 scale, StandardFont font, HorizontalAlign horizontalAlign = HorizontalAlign.Left, VerticalAlign verticalAlign = VerticalAlign.Top, float fRotation = 0.0f) : this(text, position, bottomRight, color, scale, font, horizontalAlign, verticalAlign, fRotation, Vector2.Zero)
 {
 }
Exemplo n.º 2
0
 public bool Draw(RootElement source, OnRenderEventArgs eventArgs)
 {
     if (useCustomFont)
     {
         return(MtaClient.DxDrawText(Content, Position.X, Position.Y, BottomRight.X, BottomRight.Y, Color.Hex, Scale.X, Scale.Y, CustomFont.MTAFont, HorizontalAlignment.ToString().ToLower(), VerticalAlignment.ToString().ToLower(), Clip, WordBreak, PostGUI, ColorCoded, SubPixelPositioning, Rotation, RotationOrigin.X, RotationOrigin.Y));
     }
     else
     {
         return(MtaClient.DxDrawText(Content, Position.X, Position.Y, BottomRight.X, BottomRight.Y, Color.Hex, Scale.X, Scale.Y, StandardFont.ToString().ToLower(), HorizontalAlignment.ToString().ToLower(), VerticalAlignment.ToString().ToLower(), Clip, WordBreak, PostGUI, ColorCoded, SubPixelPositioning, Rotation, RotationOrigin.X, RotationOrigin.Y));
     }
 }
Exemplo n.º 3
0
 public static bool DrawText(string text, Vector2 position, Vector2 bottomRight, Color color, Vector2 scale, StandardFont font, HorizontalAlign horizontalAlign, VerticalAlign verticalAlign, float fRotation, Vector2 fRotationCenter, bool clip = false, bool wordBreak = false, bool postGUI = false, bool colorCoded = false, bool subPixelPositioning = false)
 {
     return(MtaClient.DxDrawText(text, position.X, position.Y, bottomRight.X, bottomRight.Y, color.Hex, scale.X, scale.Y, font.ToString().ToLower(), horizontalAlign.ToString().ToLower(), verticalAlign.ToString().ToLower(), clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenter.X, fRotationCenter.Y));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a text object with a standard font
 /// </summary>
 public Text(string text, Vector2 position, Vector2 bottomRight, Color color, Vector2 scale, StandardFont font, HorizontalAlign horizontalAlign, VerticalAlign verticalAlign, float fRotation, Vector2 fRotationCenter, bool clip = false, bool wordBreak = false, bool postGUI = false, bool colorCoded = false, bool subPixelPositioning = false)
 {
     Content             = text;
     Position            = position;
     Color               = color;
     Scale               = scale;
     StandardFont        = font;
     HorizontalAlignment = horizontalAlign;
     VerticalAlignment   = verticalAlign;
     Rotation            = fRotation;
     RotationOrigin      = fRotationCenter;
     SubPixelPositioning = subPixelPositioning;
     PostGUI             = postGUI;
     Clip          = clip;
     WordBreak     = wordBreak;
     ColorCoded    = colorCoded;
     useCustomFont = false;
     BottomRight   = bottomRight;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new regular standard PDFFont with specified size
 /// </summary>
 /// <param name="font">One of the PDF Standard fonts that does not need to be included in the PDF file</param>
 /// <param name="size">The em size of the font</param>
 public PDFFont(StandardFont font, PDFUnit size)
     : this(font.ToString(), size, FontStyle.Regular)
 {
 }
Exemplo n.º 6
0
 /// <summary>
 /// Creates a new standard PDFFont with the specified size and style
 /// </summary>
 /// <param name="font">One of the PDF Standard fonts that does not need to be included in the PDF file</param>
 /// <param name="size">The em size of the font</param>
 /// <param name="style">The new font style</param>
 public PDFFont(StandardFont font, PDFUnit size, FontStyle style)
     : this(font.ToString(), size, style)
 {
 }
Exemplo n.º 7
0
 //------------------------------------------------------------------------------------------xx.03.2006
 /// <summary>Creates a new font definition for the specified standard font.</summary>
 /// <param name="report">Report to which this font definition belongs</param>
 /// <param name="standardFont">Standard font enumeration value</param>
 /// <remarks>
 /// A font family can be defined only once.
 /// You should use <see cref="M:Root.Reports.FontDef.fontDef_FromName(Root.Reports.Report,Root.Reports.FontDef.StandardFont)"/>
 /// if you are not shure whether the font is already registered.
 /// </remarks>
 /// <exception cref="ReportException">Font family is already registered.</exception>
 public FontDef(Report report, StandardFont standardFont)
     : this(report, sGetFontName(report, standardFont), fontType_Get(report, standardFont))
 {
 }
Exemplo n.º 8
0
 //----------------------------------------------------------------------------------------------------x
 /// <summary>Gets a font handle for the specified font family.</summary>
 /// <remarks>If the font family is already registered a ReportException will be thrown.</remarks>
 /// <param name="report">Report to which this font belongs</param>
 /// <param name="standardFont">Standard font enumeration value</param>
 public static FontDef fontDef_FromName(Report report, StandardFont standardFont)
 {
     return(fontDef_FromName(report, sGetFontName(standardFont)));
 }
Exemplo n.º 9
0
 //----------------------------------------------------------------------------------------------------x
 /// <summary>Initializes a new font definition.</summary>
 /// <param name="report">Report to which this font belongs</param>
 /// <param name="standardFont">Standard font enumeration value</param>
 /// <remarks>If the font family is already registered a ReportException will be thrown.</remarks>
 public FontDef(Report report, StandardFont standardFont) : this(report, sGetFontName(standardFont))
 {
 }
Exemplo n.º 10
0
 public static float GetTextWidth(string text, float scale = 1, StandardFont font = StandardFont.Default, bool colorCoded = false)
 {
     return(MtaClient.DxGetTextWidth(text, scale, font.ToString().ToLower(), colorCoded));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Get the height of a GTA font
 /// </summary>
 public static int GetHeight(StandardFont font = StandardFont.Default, float scale = 1)
 {
     return(MtaClient.DxGetFontHeight(scale, font.ToString().ToLower()));
 }