📄 usp10.h
字号:
//p piDx: Pointer to an array of dx widths in logical order, one per codepoint.
//
//p cChars: Count of the logical codepoints in the run.
//
//p cGlyphs: Glyph count.
//
//p pwLogClust: Pointer to an array of logical clusters from ScriptShape
//
//p psva: Pointer to an array of visual attributes from ScriptShape and
// updated by ScriptPlace.
//
//p piAdvance: Pointer to an array of glyph advance widths from ScriptPlace.
//
//p psa: Pointer to a SCRIPT_ANALYSIS structure from ScriptItemize and
// updated by ScriptShape and SriptPlace..
//
//p pABC: Pointer to the run overall ABC width (optional). If present,
// when the function is called, it should contain the run ABC width
// returned by ScriptPlace; when the function returns, the ABC width
// has been updated to match the new widths.
//
//p piJustify:Pointer to an array of the resulting glyph advance widths.
// This is suitable for passing to the piJustify parameter of ScriptTextOut.
///// ScriptGetCMap
//
// ScriptGetCMap may be used to determine which characters in a run
// are supported by the selected font.
//
// It returns glyph indices of Unicode characters according to Truetype
// Cmap table, or standard Cmap implemented for old style fonts. The
// glyph indices are returned in the same order as the input string.
//
// The caller may scan the returned glyph buffer looking for the default
// glyph to determine which characters are not available. (The default
// glyph index for the selected font should be determined by calling
// ScriptGetFontProperties).
//
// The return value indicates the presence of any missing glyphs.
#define SGCM_RTL 0x00000001 // Return mirrored glyph for mirrorable Unicode codepoints
HRESULT WINAPI ScriptGetCMap(
HDC hdc, // In Optional (see notes on caching)
SCRIPT_CACHE *psc, // InOut Address of Cache handle
const WCHAR *pwcInChars, // In Unicode codepoint(s) to look up
int cChars, // In Number of characters
DWORD dwFlags, // In Flags such as SGCM_RTL
WORD *pwOutGlyphs); // Out Array of glyphs, one per input character
/////
// returns S_OK - All unicode codepoints were present in the font
// S_FALSE - Some of the Unicode codepoints were mapped to the default glyph
// E_HANDLE - font or system does not support glyph indices
///// ScriptGetGlyphABCWidth
//
// Returns ABC width of a given glyph.
// May be useful for drawing glyph charts. Should not be used for
// run of the mill complex script text formatting.
HRESULT WINAPI ScriptGetGlyphABCWidth(
HDC hdc, // In Optional (see notes on caching)
SCRIPT_CACHE *psc, // InOut Address of Cache handle
WORD wGlyph, // In Glyph
ABC *pABC); // Out ABC width
/////
// returns S_OK - Glyph width returned
// E_HANDLE - font or system does not support glyph indices
///// SCRIPT_PROPERTIES
//
typedef struct {
DWORD langid :16; // Primary and sublanguage associated with script
DWORD fNumeric :1;
DWORD fComplex :1; // Script requires special shaping or layout
DWORD fNeedsWordBreaking :1; // Requires ScriptBreak for word breaking information
DWORD fNeedsCaretInfo :1; // Requires caret restriction to cluster boundaries
DWORD bCharSet :8; // Charset to use when creating font
DWORD fControl :1; // Contains only control characters
DWORD fPrivateUseArea :1; // This item is from the Unicode range U+E000 through U+F8FF
DWORD fNeedsCharacterJustify :1; // Requires inter-character justification
DWORD fInvalidGlyph :1; // Invalid combinations generate glyph wgInvalid in the glyph buffer
DWORD fInvalidLogAttr :1; // Invalid combinations are marked by fInvalid in the logical attributes
DWORD fCDM :1; // Contains Combining Diacritical Marks
DWORD fAmbiguousCharSet :1; // Script does not correspond 1:1 with a charset
DWORD fClusterSizeVaries :1; // Measured cluster width depends on adjacent clusters
DWORD fRejectInvalid :1; // Invalid combinations should be rejected
} SCRIPT_PROPERTIES;
//
//p langid: Language associated with this script. When a script is used for many languages,
// langid id represents a default language. For example, Western script is represented
// by LANG_ENGLISH although it is also used for French, German, Spanish etc.
//
//p fNumeric: Script contains numerics and characters used in conjunction with numerics
// by the rules of the Unicode bidirectional algorithm. For example
// dollar sign and period are classified as numeric when adjacent to or in between
// digits.
//
//p fComplex: Indicates a script that requires complex script handling. If fComplex is false
// the script contains no combining characters and requires no contextual shaping or reordering.
//
//p fNeedsWordBreaking: A script, such as Thai, which requires algorithmic wordbreaking.
// Use ScriptBreak to obtain a wordbreak points using the standard system wordbreaker.
//
//p fNeedsCaretInfo: A script, such as Thai and Indian, where the caret may not be placed
// inside a cluster. To determine valid caret positions inspect the fCharStop flag in the
// logical attributes returned by ScriptBreak, or compare adjacent values in the pwLogClust
// array returned by ScriptShape.
//
//p bCharSet: Nominal charset associated with script. May be used in a logfont when creating
// a font suitable for displaying this script. Note that for new scripts where there
// is no charset defined, bCharSet may be innapropriate and DEFAULT_CHARSET should
// be used instead - see the description of fAmbiguousCharSet below.
//
//p fControl: contains control characters.
//
//p fPrivateUseArea: The Unicode range U+E000 through U+F8FF.
//
//p fNeedsCharacterJustify: A script, such as Thai, where justification is conventionally
// achieved by increasing the space between all letters, not just between words.
//
//p fInvalidGlyph: A script for which ScriptShape generates an invalid glyph
// to represent invalid sequences. The glyph index of the invalid glyph for
// a particular font may be obtained by calling ScriptGetFontProperties.
//
//p fInvalidLogAttr: A script for which ScriptBreak sets the fInvalid flag
// in the logical attributes to mark invalid sequences.
//
//p fCDM: Implies that an item analysed by ScriptItemize included combining
// diacritical marks (U+0300 through U+36F).
//
//p fAmbiguousCharSet: No single legacy charset supports this script.
// For example the extended Latin Extended-A Unicode range includes
// characters from the EASTUROPE_CHARSET, the TURKISH_CHARSET and the
// BALTIC_CHARSET. It also contains characters that are not available
// in any legacy charset. Use DEFAULT_CHARSET when creating fonts to
// display parts of this run.
//
//p fClusterSizeVaries: A script, such as Arabic, where contextual shaping
// may cause a string to increase in size when removing characters.
//
//p fRejectInvalid: A script, such as Thai, where invalid sequences conventionally
// cause an editor such as notepad to beep, and ignore keypresses.
///// ScriptGetProperties
//
// ScriptGetProperties returns the address of a table that maps a
// script in a SCRIPT_ANALYSIS uScript field to properties including
// the primary language associated with that script, whether it's
// numeric and whether it's complex.
HRESULT WINAPI ScriptGetProperties(
const SCRIPT_PROPERTIES ***ppSp, // Out Receives pointer to table of pointers to properties indexed by script
int *piNumScripts); // Out Receives number of scripts (valid values are 0 through NumScripts-1)
///// SCRIPT_FONTPROPERTIES
//
typedef struct {
int cBytes; // Structure length
WORD wgBlank; // Blank glyph
WORD wgDefault; // Glyph used for Unicode values not present in the font
WORD wgInvalid; // Glyph used for invalid character combinations (especially in Thai)
WORD wgKashida; // Shortest continuous kashida glyph in the font, -1 if doesn't exist
int iKashidaWidth; // Widths of shortest continuous kashida glyph in the font
} SCRIPT_FONTPROPERTIES;
///// ScriptGetFontProperties
//
// Returns information from the font cache
HRESULT WINAPI ScriptGetFontProperties(
HDC hdc, // In Optional (see notes on caching)
SCRIPT_CACHE *psc, // InOut Address of Cache handle
SCRIPT_FONTPROPERTIES *sfp); // Out Receives properties for this font
///// ScriptCacheGetHeight
//
//
HRESULT WINAPI ScriptCacheGetHeight(
HDC hdc, // In Optional (see notes on caching)
SCRIPT_CACHE *psc, // InOut Address of Cache handle
long *tmHeight); // Out Receives font height in pixels
///// ScriptStringAnalyse
//
//
#define SSA_PASSWORD 0x00000001 // Input string contains a single character to be duplicated iLength times
#define SSA_TAB 0x00000002 // Expand tabs
#define SSA_CLIP 0x00000004 // Clip string at iReqWidth
#define SSA_FIT 0x00000008 // Justify string to iReqWidth
#define SSA_DZWG 0x00000010 // Provide representation glyphs for control characters
#define SSA_FALLBACK 0x00000020 // Use fallback fonts
#define SSA_BREAK 0x00000040 // Return break flags (character and word stops)
#define SSA_GLYPHS 0x00000080 // Generate glyphs, positions and attributes
#define SSA_RTL 0x00000100 // Base embedding level 1
#define SSA_GCP 0x00000200 // Return missing glyphs and LogCLust with GetCharacterPlacement conventions
#define SSA_HOTKEY 0x00000400 // Replace '&' with underline on subsequent codepoint
#define SSA_METAFILE 0x00000800 // Write items with ExtTextOutW Unicode calls, not glyphs
#define SSA_LINK 0x00001000 // Apply FE font linking/association to non-complex text
#define SSA_HIDEHOTKEY 0x00002000 // Remove first '&' from displayed string
#define SSA_HOTKEYONLY 0x00002400 // Display underline only.
#define SSA_FULLMEASURE 0x04000000 // Internal - calculate full width and out the number of chars can fit in iReqWidth.
#define SSA_LPKANSIFALLBACK 0x08000000 // Internal - enable FallBack for all LPK Ansi calls Except BiDi hDC calls
#define SSA_PIDX 0x10000000 // Internal
#define SSA_LAYOUTRTL 0x20000000 // Internal - Used when DC is mirrored
#define SSA_DONTGLYPH 0x40000000 // Internal - Used only by GDI during metafiling - Use ExtTextOutA for positioning
#define SSA_NOKASHIDA 0x80000000 // Internal - Used by GCP to justify the non Arabic glyphs only.
//
//
//p SSA_HOTKEY: Note that SSA_HOTKEY and SSA_HIDEHOTKEY remove the
// hotkey '&' character from further processing, so functions
// such as ScriptString_pLogAttr return arrays based on a string
// which excludes the '&'.
///// SCRIPT_TABDEF
//
// Defines tabstop positions for ScriptStringAnalyse (ignored unless SSA_TAB passed)
//
typedef struct tag_SCRIPT_TABDEF {
int cTabStops; // Number of entries in pTabStops array
int iScale; // Scale factor for pTabStops (see below)
int *pTabStops; // Pointer to array of one or more tab stops
int iTabOrigin; // Initial offset for tab stops (logical units)
} SCRIPT_TABDEF;
//
//
//p cTabStops: Number of entries in the pTabStops array. If zero, tabstops
// are every 8 average character widths. If one, all tabstops are
// the length of the first entry in pTabStops. If more than one,
// the first cTabStops are as specified in the pTabStops array,
// subsequent tabstops are every 8 average characters from the last
// tabstop in the array.
//
//p iScale: Scale factor for iTabOrigin and pTabStops entries. Values are
// converted to device coordinates by multiplying by iScale then
// dividing by 4. If values are already in device units, set iScale to
// 4. If values are in dialog units, set iScale to the average char
// width of the dialog font. If values are multiples of the average
// character width for the selected font, set iScale to 0.
//
//p pTabStops: Array of cTabStops entries. Each entry specifies a
// tabstop position. Positive values give nearedge alignment,
// negative values give faredge alignment.
//
//p iTabOrigin: Tabs are considered to start iTabOrigin before the
// beginning of the string. Helps with multiple tabbed
// outputs on the same line.
///// ScriptStringAnalyse
//
// cString - Input string must contain at least one character
//
// hdc - required if SSA
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -