-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextFormatting.cs
More file actions
28 lines (25 loc) · 846 Bytes
/
TextFormatting.cs
File metadata and controls
28 lines (25 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
namespace Docx.Renderer.Markdown;
public struct TextFormatting
{
public string StyleName { get; set; }
public bool Monospace { get; set; }
public bool Bold { get; set; }
public bool Italic { get; set; }
public bool KbdTag { get; set; }
public bool Superscript { get; set; }
public bool Subscript { get; set; }
public static bool IsBoldFont(FontValue fontFamily)
{
if (fontFamily == null) return false;
string font = fontFamily.Name.ToLower();
return font.Contains("bold");
}
public static bool IsMonospaceFont(FontValue fontFamily)
{
if (fontFamily == null) return false;
string font = fontFamily.Name.ToLower();
return font.Contains("mono")
|| font.Contains("code")
|| font is "consolas" or "courier new";
}
}