diff --git a/ClosedXML/Excel/Drawings/Style/IXLDrawingFont.cs b/ClosedXML/Excel/Drawings/Style/IXLDrawingFont.cs index 94b6850..878f23b 100644 --- a/ClosedXML/Excel/Drawings/Style/IXLDrawingFont.cs +++ b/ClosedXML/Excel/Drawings/Style/IXLDrawingFont.cs @@ -17,6 +17,6 @@ IXLDrawingStyle SetFontColor(XLColor value); IXLDrawingStyle SetFontName(String value); IXLDrawingStyle SetFontFamilyNumbering(XLFontFamilyNumberingValues value); - + IXLDrawingStyle SetFontCharSet(XLFontCharSet value); } } diff --git a/ClosedXML/Excel/Drawings/Style/XLDrawingFont.cs b/ClosedXML/Excel/Drawings/Style/XLDrawingFont.cs index 886e249..744d781 100644 --- a/ClosedXML/Excel/Drawings/Style/XLDrawingFont.cs +++ b/ClosedXML/Excel/Drawings/Style/XLDrawingFont.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace ClosedXML.Excel { @@ -29,6 +26,7 @@ public String FontName { get; set; } public XLFontFamilyNumberingValues FontFamilyNumbering { get; set; } + public XLFontCharSet FontCharSet { get; set; } public IXLDrawingStyle SetBold() { @@ -120,5 +118,10 @@ return _style; } + public IXLDrawingStyle SetFontCharSet(XLFontCharSet value) + { + FontCharSet = value; + return _style; + } } } diff --git a/ClosedXML/Excel/RichText/IXLPhonetics.cs b/ClosedXML/Excel/RichText/IXLPhonetics.cs index 0330b61..67cd96d 100644 --- a/ClosedXML/Excel/RichText/IXLPhonetics.cs +++ b/ClosedXML/Excel/RichText/IXLPhonetics.cs @@ -17,6 +17,7 @@ IXLPhonetics SetFontColor(XLColor value); IXLPhonetics SetFontName(String value); IXLPhonetics SetFontFamilyNumbering(XLFontFamilyNumberingValues value); + IXLPhonetics SetFontCharSet(XLFontCharSet value); IXLPhonetics Add(String text, Int32 start, Int32 end); IXLPhonetics ClearText(); diff --git a/ClosedXML/Excel/RichText/IXLRichString.cs b/ClosedXML/Excel/RichText/IXLRichString.cs index b41b537..a090460 100644 --- a/ClosedXML/Excel/RichText/IXLRichString.cs +++ b/ClosedXML/Excel/RichText/IXLRichString.cs @@ -10,7 +10,7 @@ public interface IXLRichString: IXLFontBase, IEquatable, IXLWithRichString { String Text { get; set; } - + IXLRichString SetBold(); IXLRichString SetBold(Boolean value); IXLRichString SetItalic(); IXLRichString SetItalic(Boolean value); @@ -22,5 +22,6 @@ IXLRichString SetFontColor(XLColor value); IXLRichString SetFontName(String value); IXLRichString SetFontFamilyNumbering(XLFontFamilyNumberingValues value); + IXLRichString SetFontCharSet(XLFontCharSet value); } } diff --git a/ClosedXML/Excel/RichText/XLPhonetics.cs b/ClosedXML/Excel/RichText/XLPhonetics.cs index 2cf1e02..b048267 100644 --- a/ClosedXML/Excel/RichText/XLPhonetics.cs +++ b/ClosedXML/Excel/RichText/XLPhonetics.cs @@ -1,6 +1,6 @@ using System; -using System.Linq; using System.Collections.Generic; +using System.Linq; namespace ClosedXML.Excel { @@ -8,7 +8,8 @@ { private readonly List _phonetics = new List(); - readonly IXLFontBase _defaultFont; + private readonly IXLFontBase _defaultFont; + public XLPhonetics(IXLFontBase defaultFont) { _defaultFont = defaultFont; @@ -22,7 +23,7 @@ _defaultFont = defaultFont; Type = defaultPhonetics.Type; Alignment = defaultPhonetics.Alignment; - + this.CopyFont(defaultPhonetics); } @@ -36,28 +37,52 @@ public XLColor FontColor { get; set; } public String FontName { get; set; } public XLFontFamilyNumberingValues FontFamilyNumbering { get; set; } + public XLFontCharSet FontCharSet { get; set; } - public IXLPhonetics SetBold() { Bold = true; return this; } public IXLPhonetics SetBold(Boolean value) { Bold = value; return this; } - public IXLPhonetics SetItalic() { Italic = true; return this; } public IXLPhonetics SetItalic(Boolean value) { Italic = value; return this; } - public IXLPhonetics SetUnderline() { Underline = XLFontUnderlineValues.Single; return this; } public IXLPhonetics SetUnderline(XLFontUnderlineValues value) { Underline = value; return this; } - public IXLPhonetics SetStrikethrough() { Strikethrough = true; return this; } public IXLPhonetics SetStrikethrough(Boolean value) { Strikethrough = value; return this; } + public IXLPhonetics SetBold() { Bold = true; return this; } + + public IXLPhonetics SetBold(Boolean value) { Bold = value; return this; } + + public IXLPhonetics SetItalic() { Italic = true; return this; } + + public IXLPhonetics SetItalic(Boolean value) { Italic = value; return this; } + + public IXLPhonetics SetUnderline() { Underline = XLFontUnderlineValues.Single; return this; } + + public IXLPhonetics SetUnderline(XLFontUnderlineValues value) { Underline = value; return this; } + + public IXLPhonetics SetStrikethrough() { Strikethrough = true; return this; } + + public IXLPhonetics SetStrikethrough(Boolean value) { Strikethrough = value; return this; } + public IXLPhonetics SetVerticalAlignment(XLFontVerticalTextAlignmentValues value) { VerticalAlignment = value; return this; } - public IXLPhonetics SetShadow() { Shadow = true; return this; } public IXLPhonetics SetShadow(Boolean value) { Shadow = value; return this; } + + public IXLPhonetics SetShadow() { Shadow = true; return this; } + + public IXLPhonetics SetShadow(Boolean value) { Shadow = value; return this; } + public IXLPhonetics SetFontSize(Double value) { FontSize = value; return this; } + public IXLPhonetics SetFontColor(XLColor value) { FontColor = value; return this; } + public IXLPhonetics SetFontName(String value) { FontName = value; return this; } + public IXLPhonetics SetFontFamilyNumbering(XLFontFamilyNumberingValues value) { FontFamilyNumbering = value; return this; } + public IXLPhonetics SetFontCharSet(XLFontCharSet value) { FontCharSet = value; return this; } + public IXLPhonetics Add(String text, Int32 start, Int32 end) { _phonetics.Add(new XLPhonetic(text, start, end)); return this; } + public IXLPhonetics ClearText() { _phonetics.Clear(); return this; } + public IXLPhonetics ClearFont() { this.CopyFont(_defaultFont); @@ -70,6 +95,7 @@ public XLPhoneticType Type { get; set; } public IXLPhonetics SetAlignment(XLPhoneticAlignment phoneticAlignment) { Alignment = phoneticAlignment; return this; } + public IXLPhonetics SetType(XLPhoneticType phoneticType) { Type = phoneticType; return this; } public IEnumerator GetEnumerator() @@ -104,8 +130,7 @@ && FontSize == other.FontSize && FontColor.Equals(other.FontColor) && FontName == other.FontName - && FontFamilyNumbering == other.FontFamilyNumbering - ; + && FontFamilyNumbering == other.FontFamilyNumbering; } } } diff --git a/ClosedXML/Excel/RichText/XLRichString.cs b/ClosedXML/Excel/RichText/XLRichString.cs index b9e9cdd..9837fdb 100644 --- a/ClosedXML/Excel/RichText/XLRichString.cs +++ b/ClosedXML/Excel/RichText/XLRichString.cs @@ -33,6 +33,7 @@ public XLColor FontColor { get; set; } public String FontName { get; set; } public XLFontFamilyNumberingValues FontFamilyNumbering { get; set; } + public XLFontCharSet FontCharSet { get; set; } public IXLRichString SetBold() { Bold = true; return this; } public IXLRichString SetBold(Boolean value) { Bold = value; return this; } public IXLRichString SetItalic() { Italic = true; return this; } public IXLRichString SetItalic(Boolean value) { Italic = value; return this; } @@ -44,6 +45,7 @@ public IXLRichString SetFontColor(XLColor value) { FontColor = value; return this; } public IXLRichString SetFontName(String value) { FontName = value; return this; } public IXLRichString SetFontFamilyNumbering(XLFontFamilyNumberingValues value) { FontFamilyNumbering = value; return this; } + public IXLRichString SetFontCharSet(XLFontCharSet value) { FontCharSet = value; return this; } public Boolean Equals(IXLRichString other) { diff --git a/ClosedXML/Excel/Style/IXLFont.cs b/ClosedXML/Excel/Style/IXLFont.cs index 2262d35..a996b62 100644 --- a/ClosedXML/Excel/Style/IXLFont.cs +++ b/ClosedXML/Excel/Style/IXLFont.cs @@ -19,7 +19,7 @@ } public enum XLFontFamilyNumberingValues - { + { NotApplicable = 0, Roman = 1, Swiss = 2, @@ -28,18 +28,131 @@ Decorative = 5 } + public enum XLFontCharSet + { + /// + /// ASCII character set. + /// + Ansi = 0, + + /// + /// System default character set. + /// + Default = 1, + + /// + /// Symbol character set. + /// + Symbol = 2, + + /// + /// Characters used by Macintosh. + /// + Mac = 77, + + /// + /// Japanese character set. + /// + ShiftJIS = 128, + + /// + /// Korean character set. + /// + Hangul = 129, + + /// + /// Another common spelling of the Korean character set. + /// + Hangeul = 129, + + /// + /// Korean character set. + /// + Johab = 130, + + /// + /// Chinese character set used in mainland China. + /// + GB2312 = 134, + + /// + /// Chinese character set used mostly in Hong Kong SAR and Taiwan. + /// + ChineseBig5 = 136, + + /// + /// Greek character set. + /// + Greek = 161, + + /// + /// Turkish character set. + /// + Turkish = 162, + + /// + /// Vietnamese character set. + /// + Vietnamese = 163, + + /// + /// Hebrew character set. + /// + Hebrew = 177, + + /// + /// Arabic character set. + /// + Arabic = 178, + + /// + /// Baltic character set. + /// + Baltic = 186, + + /// + /// Russian character set. + /// + Russian = 204, + + /// + /// Thai character set. + /// + Thai = 222, + + /// + /// Eastern European character set. + /// + EastEurope = 238, + + /// + /// Extended ASCII character set used with disk operating system (DOS) and some Microsoft Windows fonts. + /// + Oem = 255 + } + public interface IXLFont : IXLFontBase, IEquatable { IXLStyle SetBold(); IXLStyle SetBold(Boolean value); + IXLStyle SetItalic(); IXLStyle SetItalic(Boolean value); + IXLStyle SetUnderline(); IXLStyle SetUnderline(XLFontUnderlineValues value); + IXLStyle SetStrikethrough(); IXLStyle SetStrikethrough(Boolean value); + IXLStyle SetVerticalAlignment(XLFontVerticalTextAlignmentValues value); + IXLStyle SetShadow(); IXLStyle SetShadow(Boolean value); + IXLStyle SetFontSize(Double value); + IXLStyle SetFontColor(XLColor value); + IXLStyle SetFontName(String value); + IXLStyle SetFontFamilyNumbering(XLFontFamilyNumberingValues value); + IXLStyle SetFontCharSet(XLFontCharSet value); } } diff --git a/ClosedXML/Excel/Style/IXLFontBase.cs b/ClosedXML/Excel/Style/IXLFontBase.cs index 11d8a72..629cab1 100644 --- a/ClosedXML/Excel/Style/IXLFontBase.cs +++ b/ClosedXML/Excel/Style/IXLFontBase.cs @@ -2,7 +2,7 @@ namespace ClosedXML.Excel { - + public interface IXLFontBase { @@ -16,7 +16,6 @@ XLColor FontColor { get; set; } String FontName { get; set; } XLFontFamilyNumberingValues FontFamilyNumbering { get; set; } - - + XLFontCharSet FontCharSet { get; set; } } } diff --git a/ClosedXML/Excel/Style/XLFont.cs b/ClosedXML/Excel/Style/XLFont.cs index 3c52c20..87915b4 100644 --- a/ClosedXML/Excel/Style/XLFont.cs +++ b/ClosedXML/Excel/Style/XLFont.cs @@ -9,6 +9,7 @@ private Boolean _bold; private XLColor _fontColor; private XLFontFamilyNumberingValues _fontFamilyNumbering; + private XLFontCharSet _fontCharSet; private String _fontName; private Double _fontSize; private Boolean _italic; @@ -37,6 +38,7 @@ _fontColor = defaultFont.FontColor; _fontName = defaultFont.FontName; _fontFamilyNumbering = defaultFont.FontFamilyNumbering; + _fontCharSet = defaultFont.FontCharSet; if (useDefaultModify) { @@ -52,6 +54,7 @@ FontColorModified = d.FontColorModified; FontNameModified = d.FontNameModified; FontFamilyNumberingModified = d.FontFamilyNumberingModified; + FontCharSetModified = d.FontCharSetModified; } } @@ -105,7 +108,7 @@ _underline = value; UnderlineModified = true; } - + } } @@ -236,6 +239,23 @@ } } + public Boolean FontCharSetModified { get; set; } + public XLFontCharSet FontCharSet + { + get { return _fontCharSet; } + set + { + SetStyleChanged(); + if (_container != null && !_container.UpdatingStyle) + _container.Styles.ForEach(s => s.Font.FontCharSet = value); + else + { + _fontCharSet = value; + FontCharSetModified = true; + } + } + } + public IXLStyle SetBold() { Bold = true; @@ -326,6 +346,12 @@ return _container.Style; } + public IXLStyle SetFontCharSet(XLFontCharSet value) + { + FontCharSet = value; + return _container.Style; + } + public Boolean Equals(IXLFont other) { var otherF = other as XLFont; @@ -397,4 +423,4 @@ ^ (Int32)FontFamilyNumbering; } } -} \ No newline at end of file +} diff --git a/ClosedXML/Excel/XLWorkbook.cs b/ClosedXML/Excel/XLWorkbook.cs index c014def..1177678 100644 --- a/ClosedXML/Excel/XLWorkbook.cs +++ b/ClosedXML/Excel/XLWorkbook.cs @@ -51,60 +51,62 @@ { get { - return _defaultStyle ?? (_defaultStyle = new XLStyle(null) - { - Font = new XLFont(null, null) - { - Bold = false, - Italic = false, - Underline = XLFontUnderlineValues.None, - Strikethrough = false, - VerticalAlignment = XLFontVerticalTextAlignmentValues.Baseline, - FontSize = 11, - FontColor = XLColor.FromArgb(0, 0, 0), - FontName = "Calibri", - FontFamilyNumbering = XLFontFamilyNumberingValues.Swiss - }, - Fill = new XLFill(null) - { - BackgroundColor = XLColor.FromIndex(64), - PatternType = XLFillPatternValues.None, - PatternColor = XLColor.FromIndex(64) - }, - Border = new XLBorder(null, null) - { - BottomBorder = XLBorderStyleValues.None, - DiagonalBorder = XLBorderStyleValues.None, - DiagonalDown = false, - DiagonalUp = false, - LeftBorder = XLBorderStyleValues.None, - RightBorder = XLBorderStyleValues.None, - TopBorder = XLBorderStyleValues.None, - BottomBorderColor = XLColor.Black, - DiagonalBorderColor = XLColor.Black, - LeftBorderColor = XLColor.Black, - RightBorderColor = XLColor.Black, - TopBorderColor = XLColor.Black - }, - NumberFormat = new XLNumberFormat(null, null) { NumberFormatId = 0 }, - Alignment = new XLAlignment(null) - { - Indent = 0, - Horizontal = XLAlignmentHorizontalValues.General, - JustifyLastLine = false, - ReadingOrder = XLAlignmentReadingOrderValues.ContextDependent, - RelativeIndent = 0, - ShrinkToFit = false, - TextRotation = 0, - Vertical = XLAlignmentVerticalValues.Bottom, - WrapText = false - }, - Protection = new XLProtection(null) - { - Locked = true, - Hidden = false - } - }); + return _defaultStyle + ?? (_defaultStyle = new XLStyle(null) + { + Font = new XLFont(null, null) + { + Bold = false, + Italic = false, + Underline = XLFontUnderlineValues.None, + Strikethrough = false, + VerticalAlignment = XLFontVerticalTextAlignmentValues.Baseline, + FontSize = 11, + FontColor = XLColor.FromArgb(0, 0, 0), + FontName = "Calibri", + FontFamilyNumbering = XLFontFamilyNumberingValues.Swiss, + FontCharSet = XLFontCharSet.Default + }, + Fill = new XLFill(null) + { + BackgroundColor = XLColor.FromIndex(64), + PatternType = XLFillPatternValues.None, + PatternColor = XLColor.FromIndex(64) + }, + Border = new XLBorder(null, null) + { + BottomBorder = XLBorderStyleValues.None, + DiagonalBorder = XLBorderStyleValues.None, + DiagonalDown = false, + DiagonalUp = false, + LeftBorder = XLBorderStyleValues.None, + RightBorder = XLBorderStyleValues.None, + TopBorder = XLBorderStyleValues.None, + BottomBorderColor = XLColor.Black, + DiagonalBorderColor = XLColor.Black, + LeftBorderColor = XLColor.Black, + RightBorderColor = XLColor.Black, + TopBorderColor = XLColor.Black + }, + NumberFormat = new XLNumberFormat(null, null) { NumberFormatId = 0 }, + Alignment = new XLAlignment(null) + { + Indent = 0, + Horizontal = XLAlignmentHorizontalValues.General, + JustifyLastLine = false, + ReadingOrder = XLAlignmentReadingOrderValues.ContextDependent, + RelativeIndent = 0, + ShrinkToFit = false, + TextRotation = 0, + Vertical = XLAlignmentVerticalValues.Bottom, + WrapText = false + }, + Protection = new XLProtection(null) + { + Locked = true, + Hidden = false + } + }); } } @@ -116,24 +118,24 @@ get { var defaultPageOptions = new XLPageSetup(null, null) - { - PageOrientation = XLPageOrientation.Default, - Scale = 100, - PaperSize = XLPaperSize.LetterPaper, - Margins = new XLMargins - { - Top = 0.75, - Bottom = 0.5, - Left = 0.75, - Right = 0.75, - Header = 0.5, - Footer = 0.75 - }, - ScaleHFWithDocument = true, - AlignHFWithMargins = true, - PrintErrorValue = XLPrintErrorValues.Displayed, - ShowComments = XLShowCommentsValues.None - }; + { + PageOrientation = XLPageOrientation.Default, + Scale = 100, + PaperSize = XLPaperSize.LetterPaper, + Margins = new XLMargins + { + Top = 0.75, + Bottom = 0.5, + Left = 0.75, + Right = 0.75, + Header = 0.5, + Footer = 0.75 + }, + ScaleHFWithDocument = true, + AlignHFWithMargins = true, + PrintErrorValue = XLPrintErrorValues.Displayed, + ShowComments = XLShowCommentsValues.None + }; return defaultPageOptions; } } @@ -143,10 +145,10 @@ get { return new XLOutline(null) - { - SummaryHLocation = XLOutlineSummaryHLocation.Right, - SummaryVLocation = XLOutlineSummaryVLocation.Bottom - }; + { + SummaryHLocation = XLOutlineSummaryHLocation.Right, + SummaryVLocation = XLOutlineSummaryVLocation.Bottom + }; } } @@ -323,20 +325,20 @@ private void InitializeTheme() { Theme = new XLTheme - { - Text1 = XLColor.FromHtml("#FF000000"), - Background1 = XLColor.FromHtml("#FFFFFFFF"), - Text2 = XLColor.FromHtml("#FF1F497D"), - Background2 = XLColor.FromHtml("#FFEEECE1"), - Accent1 = XLColor.FromHtml("#FF4F81BD"), - Accent2 = XLColor.FromHtml("#FFC0504D"), - Accent3 = XLColor.FromHtml("#FF9BBB59"), - Accent4 = XLColor.FromHtml("#FF8064A2"), - Accent5 = XLColor.FromHtml("#FF4BACC6"), - Accent6 = XLColor.FromHtml("#FFF79646"), - Hyperlink = XLColor.FromHtml("#FF0000FF"), - FollowedHyperlink = XLColor.FromHtml("#FF800080") - }; + { + Text1 = XLColor.FromHtml("#FF000000"), + Background1 = XLColor.FromHtml("#FFFFFFFF"), + Text2 = XLColor.FromHtml("#FF1F497D"), + Background2 = XLColor.FromHtml("#FFEEECE1"), + Accent1 = XLColor.FromHtml("#FF4F81BD"), + Accent2 = XLColor.FromHtml("#FFC0504D"), + Accent3 = XLColor.FromHtml("#FF9BBB59"), + Accent4 = XLColor.FromHtml("#FF8064A2"), + Accent5 = XLColor.FromHtml("#FF4BACC6"), + Accent6 = XLColor.FromHtml("#FFF79646"), + Hyperlink = XLColor.FromHtml("#FF0000FF"), + FollowedHyperlink = XLColor.FromHtml("#FF800080") + }; } internal XLColor GetXLColor(XLThemeColor themeColor) diff --git a/ClosedXML/Excel/XLWorkbook_Load.cs b/ClosedXML/Excel/XLWorkbook_Load.cs index be0d818..eb5abbf 100644 --- a/ClosedXML/Excel/XLWorkbook_Load.cs +++ b/ClosedXML/Excel/XLWorkbook_Load.cs @@ -1437,11 +1437,14 @@ if (fontColor.HasValue) fontBase.FontColor = fontColor; - var fontFamilyNumbering = - fontSource.Elements().FirstOrDefault(); + var fontFamilyNumbering = fontSource.Elements().FirstOrDefault(); if (fontFamilyNumbering != null && fontFamilyNumbering.Val != null) - fontBase.FontFamilyNumbering = - (XLFontFamilyNumberingValues)Int32.Parse(fontFamilyNumbering.Val.ToString()); + fontBase.FontFamilyNumbering = (XLFontFamilyNumberingValues)Int32.Parse(fontFamilyNumbering.Val.ToString()); + + var fontCharSet = fontSource.Elements().FirstOrDefault(); + if (fontCharSet != null && fontCharSet.Val != null) + fontBase.FontCharSet = (XLFontCharSet)Int32.Parse(fontCharSet.Val.ToString()); + var runFont = fontSource.Elements().FirstOrDefault(); if (runFont != null) { diff --git a/ClosedXML/Excel/XLWorkbook_Save.cs b/ClosedXML/Excel/XLWorkbook_Save.cs index aa9a77d..bd34931 100644 --- a/ClosedXML/Excel/XLWorkbook_Save.cs +++ b/ClosedXML/Excel/XLWorkbook_Save.cs @@ -3608,6 +3608,10 @@ ? new FontFamilyNumbering { Val = (Int32)fontInfo.Font.FontFamilyNumbering } : null; + var fontCharSet = (fontInfo.Font.FontCharSetModified || ignoreMod) && fontInfo.Font.FontCharSet != XLFontCharSet.Default + ? new FontCharSet { Val = (Int32)fontInfo.Font.FontCharSet } + : null; + if (bold != null) font.AppendChild(bold); if (italic != null) @@ -3628,6 +3632,8 @@ font.AppendChild(fontName); if (fontFamilyNumbering != null) font.AppendChild(fontFamilyNumbering); + if (fontCharSet != null) + font.AppendChild(fontCharSet); return font; } diff --git a/ClosedXML/Extensions.cs b/ClosedXML/Extensions.cs index 699d251..6cde6da 100644 --- a/ClosedXML/Extensions.cs +++ b/ClosedXML/Extensions.cs @@ -263,6 +263,7 @@ font.FontColor = sourceFont.FontColor; font.FontName = sourceFont.FontName; font.FontFamilyNumbering = sourceFont.FontFamilyNumbering; + font.FontCharSet = sourceFont.FontCharSet; } } diff --git a/ClosedXML_Examples/Styles/StyleFont.cs b/ClosedXML_Examples/Styles/StyleFont.cs index 7da4adf..6fed30f 100644 --- a/ClosedXML_Examples/Styles/StyleFont.cs +++ b/ClosedXML_Examples/Styles/StyleFont.cs @@ -1,6 +1,5 @@ +using ClosedXML.Excel; using System; -using ClosedXML.Excel; - namespace ClosedXML_Examples.Styles { @@ -23,6 +22,11 @@ ws.Cell(++ro, co).Value = "FontFamilyNumbering - Script"; ws.Cell(ro, co).Style.Font.FontFamilyNumbering = XLFontFamilyNumberingValues.Script; + ws.Cell(++ro, co).Value = "FontCharSet - العربية التنضيد"; + ws.Cell(ro, co).Style + .Font.SetFontName("Arabic Typesetting") + .Font.SetFontCharSet(XLFontCharSet.Arabic); + ws.Cell(++ro, co).Value = "FontName - Stencil"; ws.Cell(ro, co).Style.Font.FontName = "Stencil"; diff --git a/ClosedXML_Tests/Resource/Examples/Styles/StyleFont.xlsx b/ClosedXML_Tests/Resource/Examples/Styles/StyleFont.xlsx index 0dadd37..a9c9728 100644 --- a/ClosedXML_Tests/Resource/Examples/Styles/StyleFont.xlsx +++ b/ClosedXML_Tests/Resource/Examples/Styles/StyleFont.xlsx Binary files differ