Class Pango
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intWhether the segment should be shifted to center around the baseline.static final intWhether this run holds ellipsized text.static final intWhether to add a hyphen at the end of the run during shaping.static final intValue forstartIndexinPangoAttributethat indicates the beginning of the text.static final intValue forendIndexinPangoAttributethat indicates the end of the text.static final GlyphAPangoGlyphvalue that indicates a zero-width empty glpyh.static final GlyphAPangoGlyphvalue for invalid input.static final GlyphFlag used inPangoGlyphto turn agunicharvalue of a valid Unicode character into an unknown-character glyph for thatgunichar.static final intThe scale between dimensions used for Pango distances and device units.static final intThe major component of the version of Pango available at compile-time.static final intThe micro component of the version of Pango available at compile-time.static final intThe minor component of the version of Pango available at compile-time.static final StringA string literal containing the version of Pango available at compile-time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeattrAllowBreaksNew(boolean allowBreaks) Create a new allow-breaks attribute.static AttributeattrBackgroundAlphaNew(short alpha) Create a new background alpha attribute.static AttributeattrBackgroundNew(short red, short green, short blue) Create a new background color attribute.static AttributeattrBaselineShiftNew(int shift) Create a new baseline displacement attribute.static voidApply customization from attributes to the breaks inattrs.static AttributeattrFallbackNew(boolean enableFallback) Create a new font fallback attribute.static AttributeattrFamilyNew(String family) Create a new font family attribute.static AttributeattrFontScaleNew(FontScale scale) Create a new font scale attribute.static AttributeattrForegroundAlphaNew(short alpha) Create a new foreground alpha attribute.static AttributeattrForegroundNew(short red, short green, short blue) Create a new foreground color attribute.static AttributeCreate a new gravity hint attribute.static AttributeattrGravityNew(Gravity gravity) Create a new gravity attribute.static AttributeattrInsertHyphensNew(boolean insertHyphens) Create a new insert-hyphens attribute.static AttributeattrLetterSpacingNew(int letterSpacing) Create a new letter-spacing attribute.static AttributeattrLineHeightNew(double factor) Modify the height of logical line extents by a factor.static AttributeattrLineHeightNewAbsolute(int height) Override the height of logical line extents to beheight.static AttributeattrOverlineColorNew(short red, short green, short blue) Create a new overline color attribute.static AttributeattrOverlineNew(Overline overline) Create a new overline-style attribute.static AttributeattrRiseNew(int rise) Create a new baseline displacement attribute.static AttributeattrScaleNew(double scaleFactor) Create a new font size scale attribute.static AttributeMarks the range of the attribute as a single sentence.static AttributeattrShowNew(Set<ShowFlags> flags) Create a new attribute that influences how invisible characters are rendered.static AttributeattrShowNew(ShowFlags... flags) Create a new attribute that influences how invisible characters are rendered.static AttributeattrStretchNew(Stretch stretch) Create a new font stretch attribute.static AttributeattrStrikethroughColorNew(short red, short green, short blue) Create a new strikethrough color attribute.static AttributeattrStrikethroughNew(boolean strikethrough) Create a new strike-through attribute.static AttributeattrStyleNew(Style style) Create a new font slant style attribute.static AttributeattrTextTransformNew(TextTransform transform) Create a new attribute that influences how characters are transformed during shaping.static AttributeattrUnderlineColorNew(short red, short green, short blue) Create a new underline color attribute.static AttributeattrUnderlineNew(Underline underline) Create a new underline-style attribute.static AttributeattrVariantNew(Variant variant) Create a new font variant attribute (normal or small caps).static AttributeattrWeightNew(Weight weight) Create a new font weight attribute.static AttributeMarks the range of the attribute as a single word.static voidDeprecated.static voiddefaultBreak(String text, int length, @Nullable Analysis analysis, @Nullable Out<LogAttr[]> attrs) This is the default break algorithm.static voidextentsToPixels(@Nullable Rectangle inclusive, @Nullable Rectangle nearest) Converts extents from Pango units to device units.static DirectionfindBaseDir(String text, int length) Searches a string the first character that has a strong direction, according to the Unicode bidirectional algorithm.static voidfindParagraphBoundary(String text, int length, @Nullable Out<Integer> paragraphDelimiterIndex, @Nullable Out<Integer> nextParagraphStart) Locates a paragraph boundary intext.static voidgetLogAttrs(String text, int length, int level, Language language, @Nullable Out<LogAttr[]> attrs) Computes aPangoLogAttrfor each character intext.static booleangetMirrorChar(int ch, @Nullable Out<Integer> mirroredCh) Deprecated.UseGLib.unicharGetMirrorChar(int, org.javagi.base.Out<java.lang.Integer>)instead; the docs for that function provide full details.static booleanisZeroWidth(int ch) Checks if a character that should not be normally rendered.itemize(Context context, String text, int startIndex, int length, AttrList attrs, @Nullable AttrIterator cachedIter) Breaks a piece of text into segments with consistent directional level and font.itemizeWithBaseDir(Context context, Direction baseDir, String text, int startIndex, int length, AttrList attrs, @Nullable AttrIterator cachedIter) Likepango_itemize(), but with an explicitly specified base direction.static voidstatic booleanmarkupParserFinish(MarkupParseContext context, @Nullable Out<AttrList> attrList, @Nullable Out<String> text, @Nullable Out<Integer> accelChar) Finishes parsing markup.static MarkupParseContextmarkupParserNew(int accelMarker) Incrementally parses marked-up text to create a plain-text string and an attribute list.static booleanparseEnum(Type type, @Nullable String str, @Nullable Out<Integer> value, boolean warn, @Nullable Out<String> possibleValues) Deprecated.static booleanparseMarkup(String markupText, int length, int accelMarker, @Nullable Out<AttrList> attrList, @Nullable Out<String> text, @Nullable Out<Integer> accelChar) Parses marked-up text to create a plain-text string and an attribute list.static booleanparseStretch(String str, Out<Stretch> stretch, boolean warn) Parses a font stretch.static booleanparseStyle(String str, Out<Style> style, boolean warn) Parses a font style.static booleanparseVariant(String str, Out<Variant> variant, boolean warn) Parses a font variant.static booleanparseWeight(String str, Out<Weight> weight, boolean warn) Parses a font weight.static voidquantizeLineGeometry(Out<Integer> thickness, Out<Integer> position) Quantizes the thickness and position of a line to whole device pixels.static intreadLine(@Nullable MemorySegment stream, String str) Deprecated.reorderItems(List<Item> items) Reorder items from logical order to visual order.static booleanDeprecated.static booleanscanString(Out<String> pos, String out) Deprecated.static booleanDeprecated.static voidshape(String text, int length, Analysis analysis, GlyphString glyphs) Convert the characters intextinto glyphs.static voidshapeFull(String itemText, int itemLength, @Nullable String paragraphText, int paragraphLength, Analysis analysis, GlyphString glyphs) Convert the characters intextinto glyphs.static voidshapeItem(Item item, @Nullable String paragraphText, int paragraphLength, @Nullable LogAttr logAttrs, GlyphString glyphs, Set<ShapeFlags> flags) Convert the characters initeminto glyphs.static voidshapeItem(Item item, @Nullable String paragraphText, int paragraphLength, @Nullable LogAttr logAttrs, GlyphString glyphs, ShapeFlags... flags) Convert the characters initeminto glyphs.static voidshapeWithFlags(String itemText, int itemLength, @Nullable String paragraphText, int paragraphLength, Analysis analysis, GlyphString glyphs, Set<ShapeFlags> flags) Convert the characters intextinto glyphs.static voidshapeWithFlags(String itemText, int itemLength, @Nullable String paragraphText, int paragraphLength, Analysis analysis, GlyphString glyphs, ShapeFlags... flags) Convert the characters intextinto glyphs.static booleanDeprecated.static String[]splitFileList(String str) Deprecated.static voidtailorBreak(String text, int length, Analysis analysis, int offset, @Nullable Out<LogAttr[]> attrs) Apply language-specific tailoring to the breaks inattrs.static StringtrimString(String str) Deprecated.static DirectionunicharDirection(int ch) Determines the inherent direction of a character.static intunitsFromDouble(double d) Converts a floating-point number to Pango units.static doubleunitsToDouble(int i) Converts a number in Pango units to floating-point.static intversion()Returns the encoded version of Pango available at run-time.static @Nullable StringversionCheck(int requiredMajor, int requiredMinor, int requiredMicro) Checks that the Pango library in use is compatible with the given version.static StringReturns the version of Pango available at run-time.
-
Field Details
-
ANALYSIS_FLAG_CENTERED_BASELINE
public static final int ANALYSIS_FLAG_CENTERED_BASELINEWhether the segment should be shifted to center around the baseline.This is mainly used in vertical writing directions.
- Since:
- 1.16
- See Also:
-
ANALYSIS_FLAG_IS_ELLIPSIS
public static final int ANALYSIS_FLAG_IS_ELLIPSISWhether this run holds ellipsized text.- Since:
- 1.36.7
- See Also:
-
ANALYSIS_FLAG_NEED_HYPHEN
public static final int ANALYSIS_FLAG_NEED_HYPHENWhether to add a hyphen at the end of the run during shaping.- Since:
- 1.44
- See Also:
-
ATTR_INDEX_FROM_TEXT_BEGINNING
public static final int ATTR_INDEX_FROM_TEXT_BEGINNINGValue forstartIndexinPangoAttributethat indicates the beginning of the text.- Since:
- 1.24
- See Also:
-
ATTR_INDEX_TO_TEXT_END
public static final int ATTR_INDEX_TO_TEXT_ENDValue forendIndexinPangoAttributethat indicates the end of the text.- Since:
- 1.24
- See Also:
-
GLYPH_EMPTY
APangoGlyphvalue that indicates a zero-width empty glpyh.This is useful for example in shaper modules, to use as the glyph for various zero-width Unicode characters (those passing
isZeroWidth(int)). -
GLYPH_INVALID_INPUT
APangoGlyphvalue for invalid input.PangoLayoutproduces one such glyph per invalid input UTF-8 byte and such a glyph is rendered as a crossed box.Note that this value is defined such that it has the
PANGO_GLYPH_UNKNOWN_FLAGset.- Since:
- 1.20
-
GLYPH_UNKNOWN_FLAG
Flag used inPangoGlyphto turn agunicharvalue of a valid Unicode character into an unknown-character glyph for thatgunichar.Such unknown-character glyphs may be rendered as a 'hex box'.
-
SCALE
public static final int SCALEThe scale between dimensions used for Pango distances and device units.The definition of device units is dependent on the output device; it will typically be pixels for a screen, and points for a printer.
PANGO_SCALEis currently 1024, but this may be changed in the future.When setting font sizes, device units are always considered to be points (as in "12 point font"), rather than pixels.
- See Also:
-
VERSION_MAJOR
public static final int VERSION_MAJORThe major component of the version of Pango available at compile-time.- See Also:
-
VERSION_MICRO
public static final int VERSION_MICROThe micro component of the version of Pango available at compile-time.- See Also:
-
VERSION_MINOR
public static final int VERSION_MINORThe minor component of the version of Pango available at compile-time.- See Also:
-
VERSION_STRING
A string literal containing the version of Pango available at compile-time.- See Also:
-
-
Constructor Details
-
Pango
public Pango()
-
-
Method Details
-
javagi$ensureInitialized
public static void javagi$ensureInitialized() -
attrAllowBreaksNew
Create a new allow-breaks attribute.If breaks are disabled, the range will be kept in a single run, as far as possible.
- Parameters:
allowBreaks-trueif we line breaks are allowed- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.44
-
attrBackgroundAlphaNew
Create a new background alpha attribute.- Parameters:
alpha- the alpha value, between 1 and 65536- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.38
-
attrBackgroundNew
Create a new background color attribute.- Parameters:
red- the red value (ranging from 0 to 65535)green- the green valueblue- the blue value- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrBaselineShiftNew
Create a new baseline displacement attribute.The effect of this attribute is to shift the baseline of a run, relative to the run of preceding run.

- Parameters:
shift- either aPangoBaselineShiftenumeration value or an absolute value (> 1024) in Pango units, relative to the baseline of the previous run. Positive values displace the text upwards.- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.50
-
attrBreak
public static void attrBreak(String text, int length, AttrList attrList, int offset, @Nullable Out<LogAttr[]> attrs) Apply customization from attributes to the breaks inattrs.The line breaks are assumed to have been produced by
defaultBreak(java.lang.String, int, org.gnome.pango.Analysis, org.javagi.base.Out<org.gnome.pango.LogAttr[]>)andtailorBreak(java.lang.String, int, org.gnome.pango.Analysis, int, org.javagi.base.Out<org.gnome.pango.LogAttr[]>).- Parameters:
text- text to break. Must be valid UTF-8length- length of text in bytes (may be -1 iftextis nul-terminated)attrList-PangoAttrListto applyoffset- Byte offset oftextfrom the beginning of the paragraphattrs- array with onePangoLogAttrper character intext,plus one extra, to be filled in- Since:
- 1.50
-
attrFallbackNew
Create a new font fallback attribute.If fallback is disabled, characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text.
- Parameters:
enableFallback-trueif we should fall back on other fonts for characters the active font is missing- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.4
-
attrFamilyNew
Create a new font family attribute.- Parameters:
family- the family or comma-separated list of families- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrFontScaleNew
Create a new font scale attribute.The effect of this attribute is to change the font size of a run, relative to the size of preceding run.
- Parameters:
scale- aPangoFontScalevalue, which indicates font size change relative to the size of the previous run.- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.50
-
attrForegroundAlphaNew
Create a new foreground alpha attribute.- Parameters:
alpha- the alpha value, between 1 and 65536- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.38
-
attrForegroundNew
Create a new foreground color attribute.- Parameters:
red- the red value (ranging from 0 to 65535)green- the green valueblue- the blue value- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrGravityHintNew
Create a new gravity hint attribute.- Parameters:
hint- the gravity hint value- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.16
-
attrGravityNew
Create a new gravity attribute.- Parameters:
gravity- the gravity value; should not beGravity.AUTO- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.16
-
attrInsertHyphensNew
Create a new insert-hyphens attribute.Pango will insert hyphens when breaking lines in the middle of a word. This attribute can be used to suppress the hyphen.
- Parameters:
insertHyphens-trueif hyphens should be inserted- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.44
-
attrLetterSpacingNew
Create a new letter-spacing attribute.- Parameters:
letterSpacing- amount of extra space to add between graphemes of the text, in Pango units- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.6
-
attrLineHeightNew
Modify the height of logical line extents by a factor.This affects the values returned by
LayoutLine.getExtents(org.gnome.pango.Rectangle, org.gnome.pango.Rectangle),LayoutLine.getPixelExtents(org.gnome.pango.Rectangle, org.gnome.pango.Rectangle)andLayoutIter.getLineExtents(org.gnome.pango.Rectangle, org.gnome.pango.Rectangle).- Parameters:
factor- the scaling factor to apply to the logical height- Since:
- 1.50
-
attrLineHeightNewAbsolute
Override the height of logical line extents to beheight.This affects the values returned by
LayoutLine.getExtents(org.gnome.pango.Rectangle, org.gnome.pango.Rectangle),LayoutLine.getPixelExtents(org.gnome.pango.Rectangle, org.gnome.pango.Rectangle)andLayoutIter.getLineExtents(org.gnome.pango.Rectangle, org.gnome.pango.Rectangle).- Parameters:
height- the line height, inPANGO_SCALE-ths of a point- Since:
- 1.50
-
attrOverlineColorNew
Create a new overline color attribute.This attribute modifies the color of overlines. If not set, overlines will use the foreground color.
- Parameters:
red- the red value (ranging from 0 to 65535)green- the green valueblue- the blue value- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.46
-
attrOverlineNew
Create a new overline-style attribute.- Parameters:
overline- the overline style- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.46
-
attrRiseNew
Create a new baseline displacement attribute.- Parameters:
rise- the amount that the text should be displaced vertically, in Pango units. Positive values displace the text upwards.- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrScaleNew
Create a new font size scale attribute.The base font for the affected text will have its size multiplied by
scaleFactor.- Parameters:
scaleFactor- factor to scale the font- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrSentenceNew
Marks the range of the attribute as a single sentence.Note that this may require adjustments to word and sentence classification around the range.
- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.50
-
attrShowNew
Create a new attribute that influences how invisible characters are rendered.- Parameters:
flags-PangoShowFlagsto apply- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.44
-
attrShowNew
Create a new attribute that influences how invisible characters are rendered.- Parameters:
flags-PangoShowFlagsto apply- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.44
-
attrStretchNew
Create a new font stretch attribute.- Parameters:
stretch- the stretch- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrStrikethroughColorNew
Create a new strikethrough color attribute.This attribute modifies the color of strikethrough lines. If not set, strikethrough lines will use the foreground color.
- Parameters:
red- the red value (ranging from 0 to 65535)green- the green valueblue- the blue value- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.8
-
attrStrikethroughNew
Create a new strike-through attribute.- Parameters:
strikethrough-trueif the text should be struck-through- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrStyleNew
Create a new font slant style attribute.- Parameters:
style- the slant style- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrTextTransformNew
Create a new attribute that influences how characters are transformed during shaping.- Parameters:
transform-PangoTextTransformto apply- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.50
-
attrUnderlineColorNew
Create a new underline color attribute.This attribute modifies the color of underlines. If not set, underlines will use the foreground color.
- Parameters:
red- the red value (ranging from 0 to 65535)green- the green valueblue- the blue value- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.8
-
attrUnderlineNew
Create a new underline-style attribute.- Parameters:
underline- the underline style- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrVariantNew
Create a new font variant attribute (normal or small caps).- Parameters:
variant- the variant- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy().
-
attrWeightNew
Create a new font weight attribute.- Parameters:
weight- the weight- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy()
-
attrWordNew
Marks the range of the attribute as a single word.Note that this may require adjustments to word and sentence classification around the range.
- Returns:
- the newly allocated
PangoAttribute, which should be freed withAttribute.destroy() - Since:
- 1.50
-
break_
@Deprecated public static void break_(String text, int length, Analysis analysis, @Nullable Out<LogAttr[]> attrs) Deprecated.UsedefaultBreak(java.lang.String, int, org.gnome.pango.Analysis, org.javagi.base.Out<org.gnome.pango.LogAttr[]>),tailorBreak(java.lang.String, int, org.gnome.pango.Analysis, int, org.javagi.base.Out<org.gnome.pango.LogAttr[]>)andattrBreak(java.lang.String, int, org.gnome.pango.AttrList, int, org.javagi.base.Out<org.gnome.pango.LogAttr[]>).Determines possible line, word, and character breaks for a string of Unicode text with a single analysis.For most purposes you may want to use
getLogAttrs(java.lang.String, int, int, org.gnome.pango.Language, org.javagi.base.Out<org.gnome.pango.LogAttr[]>).- Parameters:
text- the text to process. Must be valid UTF-8length- length oftextin bytes (may be -1 iftextis nul-terminated)analysis-PangoAnalysisstructure fortextattrs- an array to store character information in
-
defaultBreak
public static void defaultBreak(String text, int length, @Nullable Analysis analysis, @Nullable Out<LogAttr[]> attrs) This is the default break algorithm.It applies rules from the Unicode Line Breaking Algorithm without language-specific tailoring, therefore the
analyisargument is unused and can benull.See
tailorBreak(java.lang.String, int, org.gnome.pango.Analysis, int, org.javagi.base.Out<org.gnome.pango.LogAttr[]>)for language-specific breaks.See
attrBreak(java.lang.String, int, org.gnome.pango.AttrList, int, org.javagi.base.Out<org.gnome.pango.LogAttr[]>)for attribute-based customization.- Parameters:
text- text to break. Must be valid UTF-8length- length of text in bytes (may be -1 iftextis nul-terminated)analysis- aPangoAnalysisstructure for thetextattrs- logical attributes to fill in
-
extentsToPixels
Converts extents from Pango units to device units.The conversion is done by dividing by the
PANGO_SCALEfactor and performing rounding.The
inclusiverectangle is converted by flooring the x/y coordinates and extending width/height, such that the final rectangle completely includes the original rectangle.The
nearestrectangle is converted by rounding the coordinates of the rectangle to the nearest device unit (pixel).The rule to which argument to use is: if you want the resulting device-space rectangle to completely contain the original rectangle, pass it in as
inclusive.If you want two touching-but-not-overlapping rectangles stay touching-but-not-overlapping after rounding to device units, pass them in asnearest.- Parameters:
inclusive- rectangle to round to pixels inclusivelynearest- rectangle to round to nearest pixels- Since:
- 1.16
-
findBaseDir
Searches a string the first character that has a strong direction, according to the Unicode bidirectional algorithm.- Parameters:
text- the text to process. Must be valid UTF-8length- length oftextin bytes (may be -1 iftextis nul-terminated)- Returns:
- The direction corresponding to the first strong character.
If no such character is found, then
Direction.NEUTRALis returned. - Since:
- 1.4
-
findParagraphBoundary
public static void findParagraphBoundary(String text, int length, @Nullable Out<Integer> paragraphDelimiterIndex, @Nullable Out<Integer> nextParagraphStart) Locates a paragraph boundary intext.A boundary is caused by delimiter characters, such as a newline, carriage return, carriage return-newline pair, or Unicode paragraph separator character.
The index of the run of delimiters is returned in
paragraphDelimiterIndex.The index of the start of the next paragraph (index after all delimiters) is stored nnextParagraphStart.If no delimiters are found, both
paragraphDelimiterIndexandnextParagraphStartare filled with the length oftext(an index one off the end).- Parameters:
text- UTF-8 textlength- length oftextin bytes, or -1 if nul-terminatedparagraphDelimiterIndex- return location for index of delimiternextParagraphStart- return location for start of next paragraph
-
getLogAttrs
public static void getLogAttrs(String text, int length, int level, Language language, @Nullable Out<LogAttr[]> attrs) Computes aPangoLogAttrfor each character intext.The
attrsarray must have onePangoLogAttrfor each position intext;iftextcontains N characters, it has N+1 positions, including the last position at the end of the text.textshould be an entire paragraph; logical attributes can't be computed without context (for example you need to see spaces on either side of a word to know the word is a word).- Parameters:
text- text to process. Must be valid UTF-8length- length in bytes oftextlevel- embedding level, or -1 if unknownlanguage- language tagattrs- array with onePangoLogAttrper character intext,plus one extra, to be filled in
-
getMirrorChar
Deprecated.UseGLib.unicharGetMirrorChar(int, org.javagi.base.Out<java.lang.Integer>)instead; the docs for that function provide full details.Returns the mirrored character of a Unicode character.Mirror characters are determined by the Unicode mirrored property.
- Parameters:
ch- a Unicode charactermirroredCh- location to store the mirrored character- Returns:
trueifchhas a mirrored character andmirroredChis filled in,falseotherwise
-
isZeroWidth
public static boolean isZeroWidth(int ch) Checks if a character that should not be normally rendered.This includes all Unicode characters with "ZERO WIDTH" in their name, as well as bidi formatting characters, and a few other ones.
This is totally different from
GLib.unicharIszerowidth(int)and is at best misnamed.- Parameters:
ch- a Unicode character- Returns:
trueifchis a zero-width character,falseotherwise- Since:
- 1.10
-
itemize
public static List<Item> itemize(Context context, String text, int startIndex, int length, AttrList attrs, @Nullable AttrIterator cachedIter) Breaks a piece of text into segments with consistent directional level and font.Each byte of
textwill be contained in exactly one of the items in the returned list; the generated list of items will be in logical order (the start offsets of the items are ascending).cachedItershould be an iterator overattrscurrently positioned at a range before or containingstartIndex;cachedIterwill be advanced to the range covering the position just afterstartIndex+length.(i.e. if itemizing in a loop, just keep passing in the samecachedIter).- Parameters:
context- a structure holding information that affects the itemization process.text- the text to itemize. Must be valid UTF-8startIndex- first byte intextto processlength- the number of bytes (not characters) to process afterstartIndex.This must be >= 0.attrs- the set of attributes that apply totext.cachedIter- Cached attribute iterator- Returns:
- a
GListofPango.Itemstructures. The items should be freed usingItem.free()in combination withorg.gnome.glib.List#freeFull.
-
itemizeWithBaseDir
public static List<Item> itemizeWithBaseDir(Context context, Direction baseDir, String text, int startIndex, int length, AttrList attrs, @Nullable AttrIterator cachedIter) Likepango_itemize(), but with an explicitly specified base direction.The base direction is used when computing bidirectional levels.
itemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)gets the base direction from thePangoContext(seeContext.setBaseDir(org.gnome.pango.Direction)).- Parameters:
context- a structure holding information that affects the itemization process.baseDir- base direction to use for bidirectional processingtext- the text to itemize.startIndex- first byte intextto processlength- the number of bytes (not characters) to process afterstartIndex.This must be >= 0.attrs- the set of attributes that apply totext.cachedIter- Cached attribute iterator- Returns:
- a
GListofPango.Itemstructures. The items should be freed usingItem.free()probably in combination withorg.gnome.glib.List#freeFull. - Since:
- 1.4
-
markupParserFinish
public static boolean markupParserFinish(MarkupParseContext context, @Nullable Out<AttrList> attrList, @Nullable Out<String> text, @Nullable Out<Integer> accelChar) throws GErrorException Finishes parsing markup.After feeding a Pango markup parser some data with
MarkupParseContext.parse(java.lang.String, long), use this function to get the list of attributes and text out of the markup. This function will not freecontext,useMarkupParseContext.free()to do so.- Parameters:
context- A valid parse context that was returned frommarkupParserNew(int)attrList- address of return location for aPangoAttrListtext- address of return location for text with tags strippedaccelChar- address of return location for accelerator char- Returns:
falseiferroris set, otherwisetrue- Throws:
GErrorException- seeGError- Since:
- 1.31.0
-
markupParserNew
Incrementally parses marked-up text to create a plain-text string and an attribute list.See the Pango Markup docs for details about the supported markup.
If
accelMarkeris nonzero, the given character will mark the character following it as an accelerator. For example,accelMarkermight be an ampersand or underscore. All characters marked as an accelerator will receive aUnderline.LOWattribute, and the first character so marked will be returned inaccelChar,when callingmarkupParserFinish(org.gnome.glib.MarkupParseContext, org.javagi.base.Out<org.gnome.pango.AttrList>, org.javagi.base.Out<java.lang.String>, org.javagi.base.Out<java.lang.Integer>). TwoaccelMarkercharacters following each other produce a single literalaccelMarkercharacter.To feed markup to the parser, use
MarkupParseContext.parse(java.lang.String, long)on the returnedGLib.MarkupParseContext. When done with feeding markup to the parser, usemarkupParserFinish(org.gnome.glib.MarkupParseContext, org.javagi.base.Out<org.gnome.pango.AttrList>, org.javagi.base.Out<java.lang.String>, org.javagi.base.Out<java.lang.Integer>)to get the data out of it, and then useMarkupParseContext.free()to free it.This function is designed for applications that read Pango markup from streams. To simply parse a string containing Pango markup, the
parseMarkup(java.lang.String, int, int, org.javagi.base.Out<org.gnome.pango.AttrList>, org.javagi.base.Out<java.lang.String>, org.javagi.base.Out<java.lang.Integer>)API is recommended instead.- Parameters:
accelMarker- character that precedes an accelerator, or 0 for none- Returns:
- a
GMarkupParseContextthat should be destroyed withMarkupParseContext.free(). - Since:
- 1.31.0
-
parseEnum
@Deprecated public static boolean parseEnum(Type type, @Nullable String str, @Nullable Out<Integer> value, boolean warn, @Nullable Out<String> possibleValues) Deprecated.Parses an enum type and stores the result invalue.If
strdoes not match the nick name of any of the possible values for the enum and is not an integer,falseis returned, a warning is issued ifwarnistrue, and a string representing the list of possible values is stored inpossibleValues.The list is slash-separated, eg. "none/start/middle/end".If failed and
possibleValuesis notnull, returned string should be freed using g_free().- Parameters:
type- enum type to parse, eg.PANGO_TYPE_ELLIPSIZE_MODEstr- string to parsevalue- integer to store the result inwarn- iftrue, issue a g_warning() on bad inputpossibleValues- place to store list of possible values on failure- Returns:
trueifstrwas successfully parsed- Since:
- 1.16
-
parseMarkup
public static boolean parseMarkup(String markupText, int length, int accelMarker, @Nullable Out<AttrList> attrList, @Nullable Out<String> text, @Nullable Out<Integer> accelChar) throws GErrorException Parses marked-up text to create a plain-text string and an attribute list.See the Pango Markup docs for details about the supported markup.
If
accelMarkeris nonzero, the given character will mark the character following it as an accelerator. For example,accelMarkermight be an ampersand or underscore. All characters marked as an accelerator will receive aUnderline.LOWattribute, and the first character so marked will be returned inaccelChar.TwoaccelMarkercharacters following each other produce a single literalaccelMarkercharacter.To parse a stream of pango markup incrementally, use
markupParserNew(int).If any error happens, none of the output arguments are touched except for
error.- Parameters:
markupText- markup to parse (see the Pango Markup docs)length- length ofmarkupText,or -1 if nul-terminatedaccelMarker- character that precedes an accelerator, or 0 for noneattrList- address of return location for aPangoAttrListtext- address of return location for text with tags strippedaccelChar- address of return location for accelerator char- Returns:
falseiferroris set, otherwisetrue- Throws:
GErrorException- seeGError
-
parseStretch
Parses a font stretch.The allowed values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" and "ultra_expanded". Case variations are ignored and the '_' characters may be omitted.
- Parameters:
str- a string to parse.stretch- aPangoStretchto store the result in.warn- iftrue, issue a g_warning() on bad input.- Returns:
trueifstrwas successfully parsed.
-
parseStyle
Parses a font style.The allowed values are "normal", "italic" and "oblique", case variations being ignored.
- Parameters:
str- a string to parse.style- aPangoStyleto store the result in.warn- iftrue, issue a g_warning() on bad input.- Returns:
trueifstrwas successfully parsed.
-
parseVariant
Parses a font variant.The allowed values are "normal", "small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase" and "title-caps", case variations being ignored.
- Parameters:
str- a string to parse.variant- aPangoVariantto store the result in.warn- iftrue, issue a g_warning() on bad input.- Returns:
trueifstrwas successfully parsed.
-
parseWeight
Parses a font weight.The allowed values are "heavy", "ultrabold", "bold", "normal", "light", "ultraleight" and integers. Case variations are ignored.
- Parameters:
str- a string to parse.weight- aPangoWeightto store the result in.warn- iftrue, issue a g_warning() on bad input.- Returns:
trueifstrwas successfully parsed.
-
quantizeLineGeometry
Quantizes the thickness and position of a line to whole device pixels.This is typically used for underline or strikethrough. The purpose of this function is to avoid such lines looking blurry.
Care is taken to make sure
thicknessis at least one pixel when this function returns, but returnedpositionmay become zero as a result of rounding.- Parameters:
thickness- pointer to the thickness of a line, in Pango unitsposition- corresponding position- Since:
- 1.12
-
readLine
Deprecated.Reads an entire line from a file into a buffer.Lines may be delimited with '\\n', '\\r', '\\n\\r', or '\\r\\n'. The delimiter is not written into the buffer. Text after a '
'character is treated as a comment and skipped. '\\' can be used to escape a # character. '\\' proceeding a line delimiter combines adjacent lines. A '\\' proceeding any other character is ignored and written into the output buffer unmodified.- Parameters:
stream- a stdio streamstr-GStringbuffer into which to write the result- Returns:
- 0 if the stream was already at an
EOFcharacter, otherwise the number of lines read (this is useful for maintaining a line number counter which doesn't combine lines with '\\')
-
reorderItems
Reorder items from logical order to visual order.The visual order is determined from the associated directional levels of the items. The original list is unmodified.
(Please open a bug if you use this function. It is not a particularly convenient interface, and the code is duplicated elsewhere in Pango for that reason.)
- Parameters:
items- aGListofPangoItemin logical order.- Returns:
- a
GListofPangoItemstructures in visual order.
-
scanInt
Deprecated.Scans an integer.Leading white space is skipped.
- Parameters:
pos- in/out string positionout- an int into which to write the result- Returns:
falseif a parse error occurred
-
scanString
Deprecated.Scans a string into aGStringbuffer.The string may either be a sequence of non-white-space characters, or a quoted string with '"'. Instead a quoted string, '\\"' represents a literal quote. Leading white space outside of quotes is skipped.
- Parameters:
pos- in/out string positionout- aGStringinto which to write the result- Returns:
falseif a parse error occurred
-
scanWord
Deprecated.Scans a word into aGStringbuffer.A word consists of [A-Za-z_] followed by zero or more [A-Za-z_0-9]. Leading white space is skipped.
- Parameters:
pos- in/out string positionout- aGStringinto which to write the result- Returns:
falseif a parse error occurred
-
shape
Convert the characters intextinto glyphs.Given a segment of text and the corresponding
PangoAnalysisstructure returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator), convert the characters into glyphs. You may also pass in only a substring of the item fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator).It is recommended that you use
shapeFull(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString)instead, since that API allows for shaping interaction happening across text item boundaries.Some aspects of hyphen insertion and text transformation (in particular, capitalization) require log attrs, and thus can only be handled by
shapeItem(org.gnome.pango.Item, java.lang.String, int, org.gnome.pango.LogAttr, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>).Note that the extra attributes in the
analyisthat is returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)have indices that are relative to the entire paragraph, so you need to subtract the item offset from their indices before callingshape(java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString).- Parameters:
text- the text to processlength- the length (in bytes) oftextanalysis-PangoAnalysisstructure fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)glyphs- glyph string in which to store results
-
shapeFull
public static void shapeFull(String itemText, int itemLength, @Nullable String paragraphText, int paragraphLength, Analysis analysis, GlyphString glyphs) Convert the characters intextinto glyphs.Given a segment of text and the corresponding
PangoAnalysisstructure returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator), convert the characters into glyphs. You may also pass in only a substring of the item fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator).This is similar to
shape(java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString), except it also can optionally take the full paragraph text as input, which will then be used to perform certain cross-item shaping interactions. If you have access to the broader text of whichitemTextis part of, provide the broader text asparagraphText.IfparagraphTextisnull, item text is used instead.Some aspects of hyphen insertion and text transformation (in particular, capitalization) require log attrs, and thus can only be handled by
shapeItem(org.gnome.pango.Item, java.lang.String, int, org.gnome.pango.LogAttr, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>).Note that the extra attributes in the
analyisthat is returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)have indices that are relative to the entire paragraph, so you do not pass the full paragraph text asparagraphText,you need to subtract the item offset from their indices before callingshapeFull(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString).- Parameters:
itemText- valid UTF-8 text to shape.itemLength- the length (in bytes) ofitemText.-1 means nul-terminated text.paragraphText- text of the paragraph (see details).paragraphLength- the length (in bytes) ofparagraphText.-1 means nul-terminated text.analysis-PangoAnalysisstructure fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator).glyphs- glyph string in which to store results.- Since:
- 1.32
-
shapeItem
public static void shapeItem(Item item, @Nullable String paragraphText, int paragraphLength, @Nullable LogAttr logAttrs, GlyphString glyphs, Set<ShapeFlags> flags) Convert the characters initeminto glyphs.This is similar to
shapeWithFlags(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>), except it takes aPangoIteminstead of separateitemTextandanalysisarguments.It also takes
logAttrs,which are needed for implementing some aspects of hyphen insertion and text transforms (in particular, capitalization).Note that the extra attributes in the
analyisthat is returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)have indices that are relative to the entire paragraph, so you do not pass the full paragraph text asparagraphText,you need to subtract the item offset from their indices before callingshapeWithFlags(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>).- Parameters:
item-PangoItemto shapeparagraphText- text of the paragraph (see details).paragraphLength- the length (in bytes) ofparagraphText.-1 means nul-terminated text.logAttrs- array ofPangoLogAttrforitemglyphs- glyph string in which to store resultsflags- flags influencing the shaping process- Since:
- 1.50
-
shapeItem
public static void shapeItem(Item item, @Nullable String paragraphText, int paragraphLength, @Nullable LogAttr logAttrs, GlyphString glyphs, ShapeFlags... flags) Convert the characters initeminto glyphs.This is similar to
shapeWithFlags(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>), except it takes aPangoIteminstead of separateitemTextandanalysisarguments.It also takes
logAttrs,which are needed for implementing some aspects of hyphen insertion and text transforms (in particular, capitalization).Note that the extra attributes in the
analyisthat is returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)have indices that are relative to the entire paragraph, so you do not pass the full paragraph text asparagraphText,you need to subtract the item offset from their indices before callingshapeWithFlags(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>).- Parameters:
item-PangoItemto shapeparagraphText- text of the paragraph (see details).paragraphLength- the length (in bytes) ofparagraphText.-1 means nul-terminated text.logAttrs- array ofPangoLogAttrforitemglyphs- glyph string in which to store resultsflags- flags influencing the shaping process- Since:
- 1.50
-
shapeWithFlags
public static void shapeWithFlags(String itemText, int itemLength, @Nullable String paragraphText, int paragraphLength, Analysis analysis, GlyphString glyphs, Set<ShapeFlags> flags) Convert the characters intextinto glyphs.Given a segment of text and the corresponding
PangoAnalysisstructure returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator), convert the characters into glyphs. You may also pass in only a substring of the item fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator).This is similar to
shapeFull(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString), except it also takes flags that can influence the shaping process.Some aspects of hyphen insertion and text transformation (in particular, capitalization) require log attrs, and thus can only be handled by
shapeItem(org.gnome.pango.Item, java.lang.String, int, org.gnome.pango.LogAttr, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>).Note that the extra attributes in the
analyisthat is returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)have indices that are relative to the entire paragraph, so you do not pass the full paragraph text asparagraphText,you need to subtract the item offset from their indices before callingshapeWithFlags(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>).- Parameters:
itemText- valid UTF-8 text to shapeitemLength- the length (in bytes) ofitemText.-1 means nul-terminated text.paragraphText- text of the paragraph (see details).paragraphLength- the length (in bytes) ofparagraphText.-1 means nul-terminated text.analysis-PangoAnalysisstructure fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)glyphs- glyph string in which to store resultsflags- flags influencing the shaping process- Since:
- 1.44
-
shapeWithFlags
public static void shapeWithFlags(String itemText, int itemLength, @Nullable String paragraphText, int paragraphLength, Analysis analysis, GlyphString glyphs, ShapeFlags... flags) Convert the characters intextinto glyphs.Given a segment of text and the corresponding
PangoAnalysisstructure returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator), convert the characters into glyphs. You may also pass in only a substring of the item fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator).This is similar to
shapeFull(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString), except it also takes flags that can influence the shaping process.Some aspects of hyphen insertion and text transformation (in particular, capitalization) require log attrs, and thus can only be handled by
shapeItem(org.gnome.pango.Item, java.lang.String, int, org.gnome.pango.LogAttr, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>).Note that the extra attributes in the
analyisthat is returned fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)have indices that are relative to the entire paragraph, so you do not pass the full paragraph text asparagraphText,you need to subtract the item offset from their indices before callingshapeWithFlags(java.lang.String, int, java.lang.String, int, org.gnome.pango.Analysis, org.gnome.pango.GlyphString, java.util.Set<org.gnome.pango.ShapeFlags>).- Parameters:
itemText- valid UTF-8 text to shapeitemLength- the length (in bytes) ofitemText.-1 means nul-terminated text.paragraphText- text of the paragraph (see details).paragraphLength- the length (in bytes) ofparagraphText.-1 means nul-terminated text.analysis-PangoAnalysisstructure fromitemize(org.gnome.pango.Context, java.lang.String, int, int, org.gnome.pango.AttrList, org.gnome.pango.AttrIterator)glyphs- glyph string in which to store resultsflags- flags influencing the shaping process- Since:
- 1.44
-
skipSpace
Deprecated.Skips 0 or more characters of white space.- Parameters:
pos- in/out string position- Returns:
falseif skipping the white space leaves the position at a '\\0' character.
-
splitFileList
Deprecated.Splits aG_SEARCHPATH_SEPARATOR-separated list of files, stripping white space and substituting ~/ with $HOME/.- Parameters:
str- aG_SEARCHPATH_SEPARATORseparated list of filenames- Returns:
- a list of strings to be freed with g_strfreev()
-
tailorBreak
public static void tailorBreak(String text, int length, Analysis analysis, int offset, @Nullable Out<LogAttr[]> attrs) Apply language-specific tailoring to the breaks inattrs.The line breaks are assumed to have been produced by
defaultBreak(java.lang.String, int, org.gnome.pango.Analysis, org.javagi.base.Out<org.gnome.pango.LogAttr[]>).If
offsetis not -1, it is used to apply attributes fromanalysisthat are relevant to line breaking.Note that it is better to pass -1 for
offsetand useattrBreak(java.lang.String, int, org.gnome.pango.AttrList, int, org.javagi.base.Out<org.gnome.pango.LogAttr[]>)to apply attributes to the whole paragraph.- Parameters:
text- text to process. Must be valid UTF-8length- length in bytes oftextanalysis-PangoAnalysisfortextoffset- Byte offset oftextfrom the beginning of the paragraph, or -1 to ignore attributes fromanalysisattrs- array with onePangoLogAttrper character intext,plus one extra, to be filled in- Since:
- 1.44
-
trimString
Deprecated.Trims leading and trailing whitespace from a string.- Parameters:
str- a string- Returns:
- A newly-allocated string that must be freed with g_free()
-
unicharDirection
Determines the inherent direction of a character.The inherent direction is either
PANGO_DIRECTION_LTR,PANGO_DIRECTION_RTL, orPANGO_DIRECTION_NEUTRAL.This function is useful to categorize characters into left-to-right letters, right-to-left letters, and everything else. If full Unicode bidirectional type of a character is needed,
BidiType.forUnichar(int)can be used instead.- Parameters:
ch- a Unicode character- Returns:
- the direction of the character.
-
unitsFromDouble
public static int unitsFromDouble(double d) Converts a floating-point number to Pango units.The conversion is done by multiplying
dbyPANGO_SCALEand rounding the result to nearest integer.- Parameters:
d- double floating-point value- Returns:
- the value in Pango units.
- Since:
- 1.16
-
unitsToDouble
public static double unitsToDouble(int i) Converts a number in Pango units to floating-point.The conversion is done by dividing
ibyPANGO_SCALE.- Parameters:
i- value in Pango units- Returns:
- the double value.
- Since:
- 1.16
-
version
public static int version()Returns the encoded version of Pango available at run-time.This is similar to the macro
PANGO_VERSIONexcept that the macro returns the encoded version available at compile-time. A version number can be encoded into an integer using PANGO_VERSION_ENCODE().- Returns:
- The encoded version of Pango library available at run time.
- Since:
- 1.16
-
versionCheck
public static @Nullable String versionCheck(int requiredMajor, int requiredMinor, int requiredMicro) Checks that the Pango library in use is compatible with the given version.Generally you would pass in the constants
PANGO_VERSION_MAJOR,PANGO_VERSION_MINOR,PANGO_VERSION_MICROas the three arguments to this function; that produces a check that the library in use at run-time is compatible with the version of Pango the application or module was compiled against.Compatibility is defined by two things: first the version of the running library is newer than the version
requiredMicro.Second the running library must be binary compatible with the versionrequiredMicro(same major version.)For compile-time version checking use PANGO_VERSION_CHECK().
- Parameters:
requiredMajor- the required major versionrequiredMinor- the required minor versionrequiredMicro- the required major version- Returns:
nullif the Pango library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by Pango and should not be modified or freed.- Since:
- 1.16
-
versionString
Returns the version of Pango available at run-time.This is similar to the macro
PANGO_VERSION_STRINGexcept that the macro returns the version available at compile-time.- Returns:
- A string containing the version of Pango library available at run time. The returned string is owned by Pango and should not be modified or freed.
- Since:
- 1.16
-
defaultBreak(java.lang.String, int, org.gnome.pango.Analysis, org.javagi.base.Out<org.gnome.pango.LogAttr[]>),tailorBreak(java.lang.String, int, org.gnome.pango.Analysis, int, org.javagi.base.Out<org.gnome.pango.LogAttr[]>)andattrBreak(java.lang.String, int, org.gnome.pango.AttrList, int, org.javagi.base.Out<org.gnome.pango.LogAttr[]>).