Copy-fitting
- Topics:
- Dynamic Media Classic,SDK/API
CREATED FOR:
- Developer
- User
textPs= implements a proprietary copy-fitting algorithm which automatically adjusts the font sizes to optimally fill the text area with text, minimizing extra space at the bottom while avoiding overflow.
Copy-fitting can be enabled and controlled collectively for the entire text layer, on a paragraph basis, even for an individual text span.
Specify the minimum font size with \fs and the maximum font size with \copyfit. Any number of ranges are permitted in the same RTF string. Sizes for all ranges are varied proportionally, ensuring that the desired font size ratios are maintained.
\copyfit is considered a character formatting command and has scope rules like \fs and \b.
Copy-fitting is disabled by specifying \copyfit with a size equal to or smaller than the size specified with \fs.
Limiting the number of lines
In addition to specifying the range of font sizes, the behavior of the copy-fitting algorithm can be further controlled with the \copyfitlines or \copyfitmaxlines commands, which limit the number of lines the algorithm generates. Both commands accept a line count parameter or 0, to not limit the number of lines in the copy-fitted region.
\copyfitlines permits text to overflow to additional lines when it does not fit into the specified number of lines. Explicit line breaks in the text segment to be copy-fitted are always honored.
\copyfitmaxlines always truncates extra output lines which exceed the specified limit. The specified number of lines are never exceeded, even if explicit line breaks are present. For this release of Image Serving, no more than N-1 \line markers may be present in the copy-fitted text span. Behavior is undefined if this limit is exceeded.
Examples
The following examples assume that bodies of text are provided with variables named $A$, $B$, and $C$.
Maintain the same ratio between font sizes throughout the range:
{\fs10\copyfit100 $A${\fs20\copyfit200 $B$}$C$}
$B$ is always rendered twice as large as the rest of the text. When much text is specified, $A$ and $C$ is rendered with \fs10 and $B$ with \fs20. With little text, $A$ and $C$ use \fs100 and $B$ \fs200.
Converge to a common large font size if only a small amount of text is drawn:
{\copyfit100\fs10 $A${\fs20 $B$}$C$}
At the smallest end of the range, $B$ is rendered with \fs20, twice as large as $A$ and $C$ at \fs10. All text is drawn at \fs100 (50 pts) at the opposite end of the range.
Converge to a common small font size if much text is to be rendered:
{\fs10\copyfit100 $A${\copyfit200 $B$}$C$}
All text is drawn with \fs10 on the small end of the range, while at its largest, $A$ and $C$ are rendered with \fs100 and $B$ with \fs200.
Disable copy-fitting for an inner text span:
{\fs10\copyfit100 $A${\fs50\copyfit0 $B$}$C$}
The font size for $A$ and $C$ can vary between 10 and 100, while $B$ is always rendered with \fs50.
Limit the output to a single line, even if more vertical space is available, but permit it to overflow to additional lines if too much text is specified to fit into a single line at \fs10:
{\fs10\copyfit100 \copyfitlines1 $A$}
Limit the output to a single line, even if more vertical space is available. If too much text is specified to fit into a single line at \fs10 it is truncated:
{\fs10\copyfit100 \copyfitmaxlines1 $A$}
Experience Manager
- Dynamic Media Image Serving and Image Rendering API Home
- About this release
- System requirements and prerequisites
- Disk space requirements and recommendations
- Restrictions and known issues
- Technical support
- Document conventions
- Installation
- Image Serving API
- Image Serving API
- Intended audience
- Image Serving components
- Configuration and administration
- Serving static (non-image) contents
- Troubleshooting
- HTTP protocol reference
- HTTP protocol reference overview
- HTTP protocol introduction
- Syntax and features
- Syntax and features
- Image Serving HTTP protocol basic syntax
- Image Serving HTTP protocol command
- Layering
- Layer effects
- Request nesting and embedding
- Substitution variables
- Command macros
- Image catalogs
- Object ID translation
- Text string localization
- SVG support
- Request preprocessing
- Image maps
- Image Serving color management
- Image Serving HTTP encoding
- Request locking
- Request obfuscation
- Watermarks
- Serving static (non-image) content
- Media set requests
- Text formatting
- Data types
- Command reference
- Command reference overview
- align
- anchor
- bfc
- bgc
- bgColor
- blendMode
- cache
- clipPath
- clipXPath
- color
- crop
- cropPathE
- defaultImage
- dpr
- effect
- effectMask
- extend
- fit
- flip
- fmt
- hei
- hide
- icc
- iccEmbed
- id
- imageSet
- jpegSize
- layer
- locale
- map
- mask
- maskUse
- network
- op_blur
- op_brightness
- op_colorbalance
- op_colorize
- op_contrast
- op_grow
- op_growMask
- op_growMaskR
- op_hue
- op_invert
- op_noise
- op_saturation
- op_sharpen
- op_usm
- op_usmR
- opac
- origin
- pathAttr
- pathEmbed
- perspective
- pos
- printRes
- pscan
- qlt
- quantize
- rect
- req
- res
- resMode
- rgn
- rotate
- scale
- scl
- size
- src
- template
- text
- textAngle
- textAttr
- textFlowPath
- textFlowXPath
- textPath
- textPs
- type
- wid
- xmpEmbed
- Response data
- Server behavior
- Templates
- FXG server protocol reference
- Image catalog reference
- Attributes
- Attributes reference
- AllowDirectAccess
- AllowDirectUrls
- ApplyEffectMask
- AudioBitRate
- Bfc
- BkgColor
- CacheValidationPolicy
- ClientAddressFilter
- CatalogFile
- DefaultExpiration
- DefaultExt
- DefaultFont
- DefaultImage
- DefaultImageMode
- DefaultLocale
- DefaultPix
- DefaultThumbPix
- DigimarcId
- DigimarcInfo
- ErrorImage
- ErrorDetail
- Expiration
- FontMapFile
- FullMatch
- HttpAppleStreamingContext
- HttpFlashStreamingContext
- IccBlackPointCompensation
- IccDither
- IccProfileCmyk
- IccProfileGray
- IccProfileMapFile
- IccProfileRgb
- IccProfileSrcCmyk
- IccProfileSrcGray
- IccProfileSrcRgb
- IccRenderIntent
- JpegQuality
- LocaleMap
- LocaleStrMap
- MacroFile
- MaxPix
- NonImgExpiration
- PublishInfo
- PrintResolution
- RequestLock
- RequestObfuscation
- ResMode
- Resolution
- RootId
- RootPath
- RootUrl
- RuleSetFile
- SavePath
- StaticContentCatalogFile
- StaticContentRootPath
- SvgCatalogFile
- SynthesizeFontStyles
- ThumbBkgColor
- ThumbHorizAlign
- ThumbRes
- ThumbType
- ThumbVertAlign
- TimeStamp
- TotalStreamBitRate
- TrustedDomains
- UseLastModified
- VideoBitRate
- VideoSize
- Watermark
- Image/SVG data reference
- Macro definition
- Font map
- ICC profile map reference
- Rule set reference
- Image server proxy
- Responsive Static Image Library
- Image Rendering API
- Image Rendering API
- Configuration
- Server administration
- Server administration
- Server administration preface
- Server administration overview
- Configuring and managing the server
- Configuration settings reference
- HTTP protocol reference
- HTTP protocol reference
- Introduction
- HTTP protocol syntax and features
- HTTP protocol syntax and features
- Image Rendering HTTP protocol basic syntax
- Image Rendering HTTP protocol command overview
- Vignettes
- Materials
- Advanced Render effects
- Request nesting and embedding
- Material catalogs
- Request pre-processing *
- Custom variables
- Command macros *
- Image Rendering color management *
- Color values
- Image Rendering HTTP encoding
- HTTP protocol command reference
- HTTP protocol response data
- Material catalog
- Material catalog
- Introduction
- Material catalog overview
- Attributes reference
- Attributes reference
- AllowDirectURLs
- CacheValidationPolicy
- CatalogFile
- ClientAddressFilter
- DefaultPix
- ErrorDetail
- ErrorImage
- Expiration
- Format
- IccBlackPointCompensation
- IccDither
- IccProfileCmyk
- IccProfileGray
- IccProfileMapFile
- IccProfileRgb
- IccProfileSrcCmyk
- IccProfileSrcGray
- IccProfileSrcRgb
- IccRenderIntent
- JpegQuality
- MacroFile
- MaxPix
- OnFailObj
- OnFailSel
- RenderSettings
- ResMode
- Resolution
- RootId
- RootPath *
- RootUrl *
- RuleSetFile
- Sharp
- Sharpen
- ShowOverlapObjs
- TiffEncoding
- TimeStamp
- TrustedDomains *
- UseLastModified
- VignetteMapFile
- Material data reference
- Vignette map reference
- Macro definition reference
- ICC profile map reference
- Rule set reference
- Utilities