164 *
165 * @see LEScripts.h
166 *
167 * @stable ICU 3.2
168 */
169 virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const;
170
171 //
172 // Font file access
173 //
174
175 /**
176 * This method reads a table from the font. Note that in general,
177 * it only makes sense to call this method on an <code>LEFontInstance</code>
178 * which represents a physical font - i.e. one which has been returned by
179 * <code>getSubFont()</code>. This is because each subfont in a composite font
180 * will have different tables, and there's no way to know which subfont to access.
181 *
182 * Subclasses which represent composite fonts should always return <code>NULL</code>.
183 *
184 * Note that implementing this function does not allow for range checking.
185 * Subclasses that desire the safety of range checking must implement the
186 * variation which has a length parameter.
187 *
188 * @param tableTag - the four byte table tag. (e.g. 'cmap')
189 *
190 * @return the address of the table in memory, or <code>NULL</code>
191 * if the table doesn't exist.
192 *
193 * @stable ICU 2.8
194 */
195 virtual const void *getFontTable(LETag tableTag) const = 0;
196
197 /**
198 * This method reads a table from the font. Note that in general,
199 * it only makes sense to call this method on an <code>LEFontInstance</code>
200 * which represents a physical font - i.e. one which has been returned by
201 * <code>getSubFont()</code>. This is because each subfont in a composite font
202 * will have different tables, and there's no way to know which subfont to access.
203 *
204 * Subclasses which represent composite fonts should always return <code>NULL</code>.
205 *
206 * This version sets a length, for range checking.
207 * Note that range checking can only be accomplished if this function is
208 * implemented in subclasses.
209 *
210 * @param tableTag - the four byte table tag. (e.g. 'cmap')
211 * @param length - ignored on entry, on exit will be the length of the table if known, or -1 if unknown.
212 * @return the address of the table in memory, or <code>NULL</code>
213 * if the table doesn't exist.
214 * @internal
215 */
216 virtual const void* getFontTable(LETag tableTag, size_t &length) const { length=-1; return getFontTable(tableTag); } /* -1 = unknown length */
217
218 virtual void *getKernPairs() const = 0;
219 virtual void setKernPairs(void *pairs) const = 0;
220
221 /**
222 * This method is used to determine if the font can
223 * render the given character. This can usually be done
224 * by looking the character up in the font's character
225 * to glyph mapping.
226 *
227 * The default implementation of this method will return
228 * <code>TRUE</code> if <code>mapCharToGlyph(ch)</code>
229 * returns a non-zero value.
230 *
231 * @param ch - the character to be tested
232 *
233 * @return <code>TRUE</code> if the font can render ch.
234 *
235 * @stable ICU 3.2
236 */
|
164 *
165 * @see LEScripts.h
166 *
167 * @stable ICU 3.2
168 */
169 virtual const LEFontInstance *getSubFont(const LEUnicode chars[], le_int32 *offset, le_int32 limit, le_int32 script, LEErrorCode &success) const;
170
171 //
172 // Font file access
173 //
174
175 /**
176 * This method reads a table from the font. Note that in general,
177 * it only makes sense to call this method on an <code>LEFontInstance</code>
178 * which represents a physical font - i.e. one which has been returned by
179 * <code>getSubFont()</code>. This is because each subfont in a composite font
180 * will have different tables, and there's no way to know which subfont to access.
181 *
182 * Subclasses which represent composite fonts should always return <code>NULL</code>.
183 *
184 * This version sets a length, for range checking.
185 * Note that range checking can only be accomplished if this function is
186 * implemented in subclasses.
187 *
188 * @param tableTag - the four byte table tag. (e.g. 'cmap')
189 * @param length - ignored on entry, on exit will be the length of the table if known, or -1 if unknown.
190 * @return the address of the table in memory, or <code>NULL</code>
191 * if the table doesn't exist.
192 * @internal
193 */
194 virtual const void* getFontTable(LETag tableTag, size_t &length) const = 0;
195
196 virtual void *getKernPairs() const = 0;
197 virtual void setKernPairs(void *pairs) const = 0;
198
199 /**
200 * This method is used to determine if the font can
201 * render the given character. This can usually be done
202 * by looking the character up in the font's character
203 * to glyph mapping.
204 *
205 * The default implementation of this method will return
206 * <code>TRUE</code> if <code>mapCharToGlyph(ch)</code>
207 * returns a non-zero value.
208 *
209 * @param ch - the character to be tested
210 *
211 * @return <code>TRUE</code> if the font can render ch.
212 *
213 * @stable ICU 3.2
214 */
|