// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. namespace FlaxEngine.GUI { /// /// The text block. /// public struct TextBlock { /// /// The text range. /// public TextRange Range; /// /// The text style. /// public TextBlockStyle Style; /// /// The text location and size. /// public Rectangle Bounds; /// /// Custom ascender value for the line layout (block size above the baseline). Set to 0 to use ascender from the font. /// public float Ascender; /// /// The custom tag. /// public object Tag; internal float GetAscender() { float ascender = Ascender; if (Mathf.IsZero(ascender)) { // Use ascender from the font var textBlockFont = Style.Font.GetFont(); if (textBlockFont) ascender = textBlockFont.Ascender; } return ascender; } } }