Font.LocaleId property

Gets or sets the locale identifier (language) of the formatted characters.

public int LocaleId { get; set; }


For the list of locale identifiers see https://msdn.microsoft.com/en-us/library/cc233965.aspx


Shows how to set the locale of the text that we are adding with a document builder.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// If we set the font's locale to English and insert some Russian text,
// the English locale spell checker will not recognize the text and detect it as a spelling error.
builder.Font.LocaleId = new CultureInfo("en-US", false).LCID;

// Set a matching locale for the text that we are about to add to apply the appropriate spell checker.
builder.Font.LocaleId = new CultureInfo("ru-RU", false).LCID;

doc.Save(ArtifactsDir + "Font.LocaleId.docx");

See Also