freetype/src/cid/cidgload.h
suzuki toshiya be15811c46 [t1cid] Improve cid_get_cid_from_glyph_index().
Update cid_get_cid_from_glyph_index() to
return an error and CID=0 in the case that
the specified glyph index points to an invalid
entry.

cidgload.h (cid_compute_fd_and_offsets):
Declare new helper function to set the
fd_select and 2 offsets to access the glyph
description data.

cidgload.c (cid_compute_fd_and_offsets):
Move the part loading fd_select and 2 offsets
from cid_load_glyph() to here.  If the loaded
parameters are broken, return the Invalid_Offset
error.  This function does not load the glyph
data, only fills these parameters.

(cid_load_glyph): Use new helper function in above.

cidriver.c (cid_get_cid_from_glyph_index):
Check whether the requested glyph index points
to a valid entry, by calling cid_compute_fd_and_offsets().
If it is valid, fill the cid by the glyph
index (=CID).  If it is invalid, return an
error and fill the cid by 0.
2023-05-03 01:31:37 +00:00

59 lines
1.4 KiB
C

/****************************************************************************
*
* cidgload.h
*
* OpenType Glyph Loader (specification).
*
* Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef CIDGLOAD_H_
#define CIDGLOAD_H_
#include "cidobjs.h"
FT_BEGIN_HEADER
#if 0
/* Compute the maximum advance width of a font through quick parsing */
FT_LOCAL( FT_Error )
cid_face_compute_max_advance( CID_Face face,
FT_Int* max_advance );
#endif /* 0 */
FT_LOCAL( FT_Error )
cid_slot_load_glyph( FT_GlyphSlot glyph, /* CID_Glyph_Slot */
FT_Size size, /* CID_Size */
FT_UInt glyph_index,
FT_Int32 load_flags );
FT_LOCAL( FT_Error )
cid_compute_fd_and_offsets( CID_Face face,
FT_UInt glyph_index,
FT_ULong* fd_select_p,
FT_ULong* off1_p,
FT_ULong* off2_p );
FT_END_HEADER
#endif /* CIDGLOAD_H_ */
/* END */