Latest release (March 2023)
What was changed
Key | Summary | Category |
---|---|---|
OMRJAVA-72 | Added the ability to specify text size, font and style of text elements. | New feature |
OMRJAVA-73 | Added the ability to specify text size, font and style of all texts on a page. | New feature |
Public API changes and backwards compatibility
This section lists all public API changes introduced in Aspose.OMR for Java 23.3.0 that may affect the code of existing applications.
Added public APIs:
The following public APIs have been added in this release:
font_size
markup property
Specify the font size (in pixels) for text elements. Overrides the font size specified in the page settings.
font_family
markup property
Specify the font family for text elements, for example Source Sans
. Overrides the font family specified in the page settings.
font_style
markup property
Specify the style for text elements. Overrides the font style specified in the page settings. The following styles are supported:
Value | Example |
---|---|
regular |
Normal text (default) |
bold |
Bold text |
italic |
Italic text |
underline |
Underlined text |
Multiple font styles can be combined by listing them separated by commas, for example bold, italic
.
GlobalPageSettings.FontSize
Configure the font size (in pixels) for all texts on the page, except for those directly overridden in the form’s source code.
GlobalPageSettings.FontFamily
Configure the font family for all texts on the page, except for those directly overridden in the form’s source code, for example Source Sans
.
GlobalPageSettings.FontStyle
Configure the style for all texts on the page, except for those directly overridden in the form’s source code. The following styles are supported:
Value | Example |
---|---|
GlobalPageSettings.FontStyle = FontStyle.Regular |
Normal text (default) |
GlobalPageSettings.FontStyle = FontStyle.Bold |
Bold text |
GlobalPageSettings.FontStyle = FontStyle.Italic |
Italic text |
GlobalPageSettings.FontStyle = FontStyle.Underline |
Underlined text |
Updated public APIs:
No changes.
Removed public APIs:
No changes.
Usage examples
See the examples below to learn more about the changes introduced in this release:
Configure the style of text elements
?text=Once upon a midnight dreary, while I pondered, weak and weary,
Over many a quaint and curious volume of forgotten lore-
While I nodded, nearly napping, suddenly there came a tapping,
As of some one gently rapping, rapping at my chamber door.
font_family=Courier New
font_style=bold, italic
font_size=16
Configure the style of all text on a page
OmrEngine engine = new OmrEngine();
GlobalPageSettings pageSettings = new GlobalPageSettings();
pageSettings.FontFamily = "Courier New";
pageSettings.FontSize = 16;
GlobalPageSettings.FontStyle = FontStyle.Italic;
GenerationResult res = engine.generateTemplate("source.txt", pageSettings);
res.Save("target", "omr_form");