171 x = vector.X * scale.X;
176 zero.Y = (vector.Y - (float)
LineSpacing) * scale.Y;
181 foreach (
char c
in text)
198 padding.X -= padding.
Width;
202 padding.Y =
LineSpacing - characterData.Glyph.Height - padding.
Y;
206 kerning.X =
Math.
Max(kerning.
X, 0f);
212 zero.X += kerning.X * scale.X *
one.X;
214 position.X += (float)padding.
X * scale.X;
215 position.Y += (float)padding.
Y * scale.Y;
219 zero.X += (kerning.Y + kerning.
Z) * scale.X *
one.X;
251 if (
text.Length == 0)
261 foreach (
char c
in text)
280 kerning.X =
Math.
Max(kerning.
X, 0f);
286 zero.X += kerning.X + kerning.
Y;
339 if (
text.Length == 1)
DynamicSpriteFont(float spacing, int lineSpacing, char defaultCharacter)
void SetPages(FontPage[] pages)
string CreateWrappedText(string text, float maxWidth, CultureInfo culture)
string CreateCroppedText(string text, float maxWidth)
GlyphMetrics GetCharacterMetrics(char character)
bool AreCharactersSupported(IEnumerable< char > characters)
readonly float _characterSpacing
Vector2 MeasureString(string text)
string CreateWrappedText(string text, float maxWidth)
readonly char DefaultCharacter
SpriteCharacterData GetCharacterData(char character)
readonly int _lineSpacing
Dictionary< char, SpriteCharacterData > _spriteCharacters
bool IsCharacterSupported(char character)
void InternalDraw(string text, SpriteBatch spriteBatch, Vector2 startPosition, Color color, float rotation, Vector2 origin, ref Vector2 scale, SpriteEffects spriteEffects, float depth)
SpriteCharacterData _defaultCharacterData
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ContainsKey(TKey key)
void Add(TKey key, TValue value)
static byte Max(byte val1, byte val2)
static Thread CurrentThread
static Matrix CreateTranslation(Vector3 position)
static Matrix CreateRotationZ(float radians)
static Vector2 Transform(Vector2 position, Matrix matrix)
readonly Rectangle Padding
SpriteCharacterData(Texture2D texture, Rectangle glyph, Rectangle padding, Vector3 kerning)
GlyphMetrics ToGlyphMetric()
readonly Texture2D Texture
static GlyphMetrics FromKerningData(float leftPadding, float characterWidth, float rightPadding)