Replies: 1 comment 2 replies
-
Yes, yes you can. What you are looking for is the From that API it might not be immediate obvious how you would handle specifically bold and italic options, you handle them by setting the What most people do not realise about fonts is that things like bold, italic etc are actually completely separate fonts that applications try and hide away for you. var regular = _fontManager.GetFont("SomeFont", 100, FontStyle.Regular);
var bold = _fontManager.GetFont("SomeFont", 100, FontStyle.Bold); // this could be any font not just bold etc
img.Mutate(x =>
x.DrawText(
new RichTextOptions(regular) {
Origin = new Vector2(810, 460),
LayoutMode = LayoutMode.HorizontalTopBottom,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
TextAlignment = TextAlignment.Center,
WrappingLength = 800,
TextRuns = new[]{
new RichTextRun(){ Font = bold, Start = 10, End = 33 }
}
},
"This is a <b>really important</b> point.",
Color.Black
)
); note the inline mark up is doing nothing here it's just the Grapheme index of the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using the following, I can write a block of text using a font and style of my choosing:
However, is it possible for me to write a certain portion of that text in a different style? If I want to emphasize two words for example:
If that's not possible it'd be a nice feature to have.
Beta Was this translation helpful? Give feedback.
All reactions