< prev index next >
src/java.desktop/share/native/libfreetype/src/cff/cffobjs.c
Print this page
*** 1,21 ****
! /***************************************************************************/
! /* */
! /* cffobjs.c */
! /* */
! /* OpenType objects manager (body). */
! /* */
! /* Copyright 1996-2018 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. */
! /* */
! /***************************************************************************/
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
--- 1,21 ----
! /****************************************************************************
! *
! * cffobjs.c
! *
! * OpenType objects manager (body).
! *
! * Copyright (C) 1996-2019 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.
! *
! */
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
*** 35,67 ****
#include FT_INTERNAL_CFF_OBJECTS_TYPES_H
#include "cffobjs.h"
#include "cffload.h"
#include "cffcmap.h"
- #include "cffpic.h"
#include "cfferrs.h"
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_SERVICE_CFF_TABLE_LOAD_H
! /*************************************************************************/
! /* */
! /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
! /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
! /* messages during execution. */
! /* */
#undef FT_COMPONENT
! #define FT_COMPONENT trace_cffobjs
! /*************************************************************************/
! /* */
! /* SIZE FUNCTIONS */
! /* */
! /*************************************************************************/
static PSH_Globals_Funcs
cff_size_get_globals_funcs( CFF_Size size )
{
--- 35,66 ----
#include FT_INTERNAL_CFF_OBJECTS_TYPES_H
#include "cffobjs.h"
#include "cffload.h"
#include "cffcmap.h"
#include "cfferrs.h"
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_SERVICE_CFF_TABLE_LOAD_H
! /**************************************************************************
! *
! * The macro FT_COMPONENT is used in trace mode. It is an implicit
! * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
! * messages during execution.
! */
#undef FT_COMPONENT
! #define FT_COMPONENT cffobjs
! /**************************************************************************
! *
! * SIZE FUNCTIONS
! *
! */
static PSH_Globals_Funcs
cff_size_get_globals_funcs( CFF_Size size )
{
*** 339,353 ****
return FT_Err_Ok;
}
! /*************************************************************************/
! /* */
! /* SLOT FUNCTIONS */
! /* */
! /*************************************************************************/
FT_LOCAL_DEF( void )
cff_slot_done( FT_GlyphSlot slot )
{
slot->internal->glyph_hints = NULL;
--- 338,352 ----
return FT_Err_Ok;
}
! /**************************************************************************
! *
! * SLOT FUNCTIONS
! *
! */
FT_LOCAL_DEF( void )
cff_slot_done( FT_GlyphSlot slot )
{
slot->internal->glyph_hints = NULL;
*** 381,395 ****
return FT_Err_Ok;
}
! /*************************************************************************/
! /* */
! /* FACE FUNCTIONS */
! /* */
! /*************************************************************************/
static FT_String*
cff_strcpy( FT_Memory memory,
const FT_String* source )
{
--- 380,394 ----
return FT_Err_Ok;
}
! /**************************************************************************
! *
! * FACE FUNCTIONS
! *
! */
static FT_String*
cff_strcpy( FT_Memory memory,
const FT_String* source )
{
*** 643,660 ****
cffface->num_glyphs = (FT_Long)cff->num_glyphs;
dict = &cff->top_font.font_dict;
! /* we need the `PSNames' module for CFF and CEF formats */
/* which aren't CID-keyed */
if ( dict->cid_registry == 0xFFFFU && !psnames )
{
FT_ERROR(( "cff_face_init:"
" cannot open CFF & CEF fonts\n"
" "
! " without the `PSNames' module\n" ));
error = FT_THROW( Missing_Module );
goto Exit;
}
#ifdef FT_DEBUG_LEVEL_TRACE
--- 642,659 ----
cffface->num_glyphs = (FT_Long)cff->num_glyphs;
dict = &cff->top_font.font_dict;
! /* we need the `psnames' module for CFF and CEF formats */
/* which aren't CID-keyed */
if ( dict->cid_registry == 0xFFFFU && !psnames )
{
FT_ERROR(( "cff_face_init:"
" cannot open CFF & CEF fonts\n"
" "
! " without the `psnames' module\n" ));
error = FT_THROW( Missing_Module );
goto Exit;
}
#ifdef FT_DEBUG_LEVEL_TRACE
*** 963,976 ****
cffface->style_name = style_name;
else
/* assume "Regular" style if we don't know better */
cffface->style_name = cff_strcpy( memory, (char *)"Regular" );
! /*******************************************************************/
! /* */
! /* Compute face flags. */
! /* */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
FT_FACE_FLAG_HINTER; /* has native hinter */
if ( sfnt_format )
--- 962,975 ----
cffface->style_name = style_name;
else
/* assume "Regular" style if we don't know better */
cffface->style_name = cff_strcpy( memory, (char *)"Regular" );
! /********************************************************************
! *
! * Compute face flags.
! */
flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */
FT_FACE_FLAG_HORIZONTAL | /* horizontal data */
FT_FACE_FLAG_HINTER; /* has native hinter */
if ( sfnt_format )
*** 987,1000 ****
flags |= FT_FACE_FLAG_KERNING;
#endif
cffface->face_flags |= flags;
! /*******************************************************************/
! /* */
! /* Compute style flags. */
! /* */
flags = 0;
if ( dict->italic_angle )
flags |= FT_STYLE_FLAG_ITALIC;
--- 986,999 ----
flags |= FT_FACE_FLAG_KERNING;
#endif
cffface->face_flags |= flags;
! /********************************************************************
! *
! * Compute style flags.
! */
flags = 0;
if ( dict->italic_angle )
flags |= FT_STYLE_FLAG_ITALIC;
*** 1026,1039 ****
#endif
if ( dict->cid_registry != 0xFFFFU && pure_cff )
cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;
! /*******************************************************************/
! /* */
! /* Compute char maps. */
! /* */
/* Try to synthesize a Unicode charmap if there is none available */
/* already. If an OpenType font contains a Unicode "cmap", we */
/* will use it, whatever be in the CFF part of the file. */
{
--- 1025,1038 ----
#endif
if ( dict->cid_registry != 0xFFFFU && pure_cff )
cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;
! /********************************************************************
! *
! * Compute char maps.
! */
/* Try to synthesize a Unicode charmap if there is none available */
/* already. If an OpenType font contains a Unicode "cmap", we */
/* will use it, whatever be in the CFF part of the file. */
{
*** 1068,1081 ****
cmaprec.encoding_id = TT_MS_ID_UNICODE_CS;
cmaprec.encoding = FT_ENCODING_UNICODE;
nn = (FT_UInt)cffface->num_charmaps;
! error = FT_CMap_New( &CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,
&cmaprec, NULL );
if ( error &&
! FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
goto Exit;
error = FT_Err_Ok;
/* if no Unicode charmap was previously selected, select this one */
if ( !cffface->charmap && nn != (FT_UInt)cffface->num_charmaps )
--- 1067,1081 ----
cmaprec.encoding_id = TT_MS_ID_UNICODE_CS;
cmaprec.encoding = FT_ENCODING_UNICODE;
nn = (FT_UInt)cffface->num_charmaps;
! error = FT_CMap_New( &cff_cmap_unicode_class_rec, NULL,
&cmaprec, NULL );
if ( error &&
! FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) &&
! FT_ERR_NEQ( error, Unimplemented_Feature ) )
goto Exit;
error = FT_Err_Ok;
/* if no Unicode charmap was previously selected, select this one */
if ( !cffface->charmap && nn != (FT_UInt)cffface->num_charmaps )
*** 1092,1114 ****
if ( encoding->offset == 0 )
{
cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;
cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD;
! clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
}
else if ( encoding->offset == 1 )
{
cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT;
! clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
}
else
{
cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM;
! clazz = &CFF_CMAP_ENCODING_CLASS_REC_GET;
}
error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
}
}
--- 1092,1114 ----
if ( encoding->offset == 0 )
{
cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;
cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD;
! clazz = &cff_cmap_encoding_class_rec;
}
else if ( encoding->offset == 1 )
{
cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT;
! clazz = &cff_cmap_encoding_class_rec;
}
else
{
cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM;
! clazz = &cff_cmap_encoding_class_rec;
}
error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );
}
}
< prev index next >