#include <ICompositionUtils.h>
|
| enum | { kDefaultIID = IID_ICOMPOSITIONUTILS } |
| |
|
| virtual ICalculatedTextResult * | NewCalculatedText (const ITextModel *model, TextIndex position, UTF32TextChar c, const IDrawingStyle *style=nil)=0 |
| |
| virtual ICalculatedTextResult * | NewCalculatedText (const UIDRef &forFrame, UTF32TextChar c, const IDrawingStyle *style, TextIndex position)=0 |
| |
| virtual ErrorCode | GetCalculatedTextString (const ITextModel *model, TextIndex position, UTF32TextChar c, const IDrawingStyle *style, WideString *calcText)=0 |
| |
| virtual ErrorCode | GetCalculatedTextString (const UIDRef &forFrame, UTF32TextChar c, const IDrawingStyle *style, WideString *calcText, TextIndex position)=0 |
| |
virtual ICalculatedTextResult::CalculatedStringContent | ScanStringContents (const PMString &s) const =0 |
| |
| virtual bool16 | RemapCharactersIfNecessary (const IDrawingStyle *style, const PMString &original, WideString &calcString) const =0 |
| |
| virtual ICalculatedTextResult * | InitializeCalcResult (const PMString &str, const IDrawingStyle *baseDrawStyle)=0 |
| |
| virtual PMReal | CalcLeadingModelYPosAdjustment (PMReal lineHeight, Text::LeadingModel prevLeadingModel, PMReal prevLeading, PMReal prevLeadingModelOffset, Text::LeadingModel leadingModel, PMReal leading, PMReal leadingModelOffset)=0 |
| |
| virtual void | PregenerateWaxRuns (const IWaxIterator *waxIter, TextIndex startPos, TextIndex endPos)=0 |
| |
| virtual OpenTypeFeatureList | GetCalculatedOTFeaturesList (const IDrawingStyle *draw, bool japanese=false, bool vertical=false, bool isTCY=false)=0 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
Utilities related to text composition. e.g.
Utils<ICompositionUtils>()->NewCalculatedText( ... ) ;
| virtual PMReal ICompositionUtils::CalcLeadingModelYPosAdjustment | ( | PMReal | lineHeight, | | | Text::LeadingModel | prevLeadingModel, | | | PMReal | prevLeading, | | | PMReal | prevLeadingModelOffset, | | | Text::LeadingModel | leadingModel, | | | PMReal | leading, | | | PMReal | leadingModelOffset | | ) | | |
| pure virtual |
Given the leading information for a previous WaxLine, calculates an adjustment which, when added to the previous WaxLine's YPosition, determines the initial starting YPosition for the following WaxLine. Although the values returned may be negative, it will never exceed the lineHeight. This prevents the YPosition of the next line from being above the previous line's YPosition.
| virtual OpenTypeFeatureList ICompositionUtils::GetCalculatedOTFeaturesList | ( | const IDrawingStyle * | draw, | | | bool | japanese = false, | | | bool | vertical = false, | | | bool | isTCY = false | | ) | | |
| pure virtual |
This method will return a list of substitution opentype features that are applied to the style. There are some GPOS features that are included, and some that will be left out (mostly kern & some japanese width features). There are also some heuristics related to justification that aren't in play in this routine because justification data is not here.
- Parameters
| draw | is the style in question. |
| japanese | denotes whether to use some japanese specific logic around discretionary ligatures. specifies if the text in question is vertical specifies if the vertical text in question is actually "horizontal in vertical" |
- Returns
- the list of opentype features that may be applied by the composer for this style.
Same as NewCalculatedText, except it returns just the string.
- Returns
- kSuccess when the calculated text string is correctly set. @ see NewCalculatedText
Same as NewCalculatedText, except it returns just the string.
- Returns
- kSuccess when the calculated text string is correctly set. @ see NewCalculatedText
Helper function used to generate necessary data for calculated text. May remap characters, change styles, etc.
- Parameters
| str | IN the resulting string to use. |
| baseDrawStyle | IN the style applied to the calculated text. |
| overrideDrawStyle | IN the style locally applied to the calculated text. Can be nil. |
- Returns
- the completed object containing the wide string and other relevant stuff.
Calculates the string based on the character and position passed in. Returns an object containing that string and other relevant stuff.
- Parameters
| model | IN the text model that contains the calculated text. |
| position | IN the location of the calculated text in question within the text model. |
| c | IN the text char of the calculated text in question within the text model and the given position. |
| style | IN the text attributes applied to the calculated text, if nil it will be calculated |
| setMe | OUT the object containing the calculated text and associated stuff. |
| return | kSuccess when the calculated text string is correctly set. |
- Returns
- an object containing that string and other relevant stuff.
- Note
- This method is typically used for OwnedItem based calculated text (e.g. footnotes)
Calculates the string based on the character and text frame passed in.
- Parameters
| forFrame | IN the text frame that contains the section name. |
| c | IN the text char of the calculated text in question within the text model and the given position. |
| style | IN the text attributes applied to the calculated text, should not be nil |
| setMe | OUT the object containing the calculated text and associated stuff. |
- Returns
- an object containing that string and other relevant stuff.
- Note
- This method is typically used for non-OwnedItem based calculated text (e.g. page numbers)
| virtual void ICompositionUtils::PregenerateWaxRuns | ( | const IWaxIterator * | waxIter, | | | TextIndex | startPos, | | | TextIndex | endPos | | ) | | |
| pure virtual |
Experimental routine that will try to use multiple threads to generate the runs for multiple lines in parallel.
Some fonts use custom use area characters (not unicode - e.g. Bembo Expert numbers) - this method remaps them to the right unicode (via platform encoding).
- Parameters
| style | the drawing style associated with this string |
| original | the incoming string to be scanned/remapped |
| calcString | the resulting string with remappings in place, if any |
- Returns
- whether any remapping was done
| virtual ICalculatedTextResult::CalculatedStringContent ICompositionUtils::ScanStringContents | ( | const PMString & | s | ) | const |
| pure virtual |
Scan the incoming string and return the characteristics of the contained characters
- See Also
- CalculatedStringContent