您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FT_BOOL函数代码示例

51自学网 2021-06-01 20:43:58
  C++
这篇教程C++ FT_BOOL函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中FT_BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ FT_BOOL函数的具体用法?C++ FT_BOOL怎么用?C++ FT_BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了FT_BOOL函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: af_face_globals_is_digit

  af_face_globals_is_digit( AF_FaceGlobals  globals,                            FT_UInt         gindex )  {    if ( gindex < (FT_ULong)globals->glyph_count )      return FT_BOOL( globals->glyph_styles[gindex] & AF_DIGIT );    return FT_BOOL( 0 );  }
开发者ID:GWRon,项目名称:pub.mod-NG,代码行数:8,


示例2: ftc_snode_compare

  ftc_snode_compare( FTC_Node    ftcsnode,                     FT_Pointer  ftcgquery,                     FTC_Cache   cache )  {    FTC_SNode   snode  = (FTC_SNode)ftcsnode;    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;    FTC_GNode   gnode  = FTC_GNODE( snode );    FT_UInt     gindex = gquery->gindex;    FT_Bool     result;    result = FT_BOOL( gnode->family == gquery->family                    &&                      (FT_UInt)( gindex - gnode->gindex ) < snode->count );    if ( result )    {      /* check if we need to load the glyph bitmap now */      FTC_SBit  sbit = snode->sbits + ( gindex - gnode->gindex );      if ( sbit->buffer == NULL && sbit->width != 255 )      {        FT_ULong  size;        if ( !ftc_snode_load( snode, cache->manager,                              gindex, &size ) )        {          cache->manager->cur_weight += size;        }      }    }    return result;  }
开发者ID:zdementor,项目名称:my-deps,代码行数:34,


示例3: gxv_kern_coverage_classic_microsoft_validate

  static FT_Bool  gxv_kern_coverage_classic_microsoft_validate( FT_UShort      coverage,                                                FT_UShort*     format,                                                GXV_Validator  gxvalid )  {    /* classic Microsoft-dialect */#ifdef GXV_LOAD_TRACE_VARS    FT_Bool  horizontal;    FT_Bool  minimum;    FT_Bool  cross_stream;    FT_Bool  override;#endif    FT_UNUSED( gxvalid );    /* reserved bits = 0 */    if ( coverage & 0xFDF0 )      return FALSE;#ifdef GXV_LOAD_TRACE_VARS    horizontal   = FT_BOOL(   coverage        & 1 );    minimum      = FT_BOOL( ( coverage >> 1 ) & 1 );    cross_stream = FT_BOOL( ( coverage >> 2 ) & 1 );    override     = FT_BOOL( ( coverage >> 3 ) & 1 );
开发者ID:hsmith,项目名称:freetype,代码行数:25,


示例4: ftc_cmap_node_compare

  ftc_cmap_node_compare( FTC_CMapNode   cnode,                         FTC_CMapQuery  cquery )  {    FT_UInt32  offset = (FT_UInt32)( cquery->char_code - cnode->first );    return FT_BOOL( offset < FTC_CMAP_INDICES_MAX );  }
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:8,


示例5: ftc_glyph_node_compare

  ftc_glyph_node_compare( FTC_GlyphNode   gnode,                          FTC_GlyphQuery  gquery )  {    FT_UInt  start = (FT_UInt)gnode->item_start;    FT_UInt  count = (FT_UInt)gnode->item_count;    return FT_BOOL( (FT_UInt)( gquery->gindex - start ) < count );  }
开发者ID:1tgr,项目名称:mobius,代码行数:8,


示例6: ft_cubic_is_small_enough

  static FT_Bool  ft_cubic_is_small_enough( FT_Vector*  base,                            FT_Angle   *angle_in,                            FT_Angle   *angle_mid,                            FT_Angle   *angle_out )  {    FT_Vector  d1, d2, d3;    FT_Angle   theta1, theta2;    FT_Int     close1, close2, close3;    d1.x = base[2].x - base[3].x;    d1.y = base[2].y - base[3].y;    d2.x = base[1].x - base[2].x;    d2.y = base[1].y - base[2].y;    d3.x = base[0].x - base[1].x;    d3.y = base[0].y - base[1].y;    close1 = FT_IS_SMALL( d1.x ) && FT_IS_SMALL( d1.y );    close2 = FT_IS_SMALL( d2.x ) && FT_IS_SMALL( d2.y );    close3 = FT_IS_SMALL( d3.x ) && FT_IS_SMALL( d3.y );    if ( close1 || close3 )    {      if ( close2 )      {        /* basically a point */        *angle_in = *angle_out = *angle_mid = 0;      }      else if ( close1 )      {        *angle_in  = *angle_mid = FT_Atan2( d2.x, d2.y );        *angle_out = FT_Atan2( d3.x, d3.y );      }      else  /* close2 */      {        *angle_in  = FT_Atan2( d1.x, d1.y );        *angle_mid = *angle_out = FT_Atan2( d2.x, d2.y );      }    }    else if ( close2 )    {      *angle_in  = *angle_mid = FT_Atan2( d1.x, d1.y );      *angle_out = FT_Atan2( d3.x, d3.y );    }    else    {      *angle_in  = FT_Atan2( d1.x, d1.y );      *angle_mid = FT_Atan2( d2.x, d2.y );      *angle_out = FT_Atan2( d3.x, d3.y );    }    theta1 = ft_pos_abs( FT_Angle_Diff( *angle_in,  *angle_mid ) );    theta2 = ft_pos_abs( FT_Angle_Diff( *angle_mid, *angle_out ) );    return FT_BOOL( theta1 < FT_SMALL_CUBIC_THRESHOLD &&                    theta2 < FT_SMALL_CUBIC_THRESHOLD );  }
开发者ID:gbarrand,项目名称:ArcheryTune,代码行数:58,


示例7: ftc_face_node_compare

  ftc_face_node_compare( FTC_MruNode  ftcnode,                         FT_Pointer   ftcface_id )  {    FTC_FaceNode  node    = (FTC_FaceNode)ftcnode;    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;    return FT_BOOL( node->face_id == face_id );  }
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:9,


示例8: ftc_size_node_compare

  ftc_size_node_compare( FTC_SizeNode   node,                         FTC_SizeQuery  query )  {    FT_Size  size = node->size;    return FT_BOOL( size->face                    == query->face   &&                    (FT_UInt)size->metrics.x_ppem == query->width  &&                    (FT_UInt)size->metrics.y_ppem == query->height );  }
开发者ID:8l,项目名称:inferno,代码行数:10,


示例9: ftc_cmap_node_remove_faceid

  ftc_cmap_node_remove_faceid( FTC_Node    ftcnode,                               FT_Pointer  ftcface_id,                               FTC_Cache   cache )  {    FTC_CMapNode  node    = (FTC_CMapNode)ftcnode;    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;    FT_UNUSED( cache );    return FT_BOOL( node->face_id == face_id );  }
开发者ID:Aggroo,项目名称:nebula-trifid,代码行数:10,


示例10: ftc_size_node_compare_faceid

  /* helper function used by ftc_face_node_done */  static FT_Bool  ftc_size_node_compare_faceid( FTC_MruNode  ftcnode,                                FT_Pointer   ftcface_id )  {    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;    return FT_BOOL( node->scaler.face_id == face_id );  }
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:11,


示例11: ftc_gnode_compare

  ftc_gnode_compare( FTC_Node    ftcgnode,                     FT_Pointer  ftcgquery,                     FTC_Cache   cache )  {    FTC_GNode   gnode  = (FTC_GNode)ftcgnode;    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;    FT_UNUSED( cache );    return FT_BOOL( gnode->family == gquery->family &&                    gnode->gindex == gquery->gindex );  }
开发者ID:CarloMaker,项目名称:Urho3D,代码行数:12,


示例12: ftc_image_family_compare

  ftc_image_family_compare( FTC_ImageFamily  ifam,                            FTC_ImageQuery   iquery )  {    FT_Bool  result;    result = FT_BOOL( FTC_IMAGE_TYPE_COMPARE( &ifam->type, &iquery->type ) );    if ( result )      FTC_GLYPH_FAMILY_FOUND( ifam, iquery );    return result;  }
开发者ID:1tgr,项目名称:mobius,代码行数:12,


示例13: ftc_cmap_node_remove_faceid

  ftc_cmap_node_remove_faceid( FTC_Node    ftcnode,                               FT_Pointer  ftcface_id,                               FTC_Cache   cache,                               FT_Bool*    list_changed )  {    FTC_CMapNode  node    = (FTC_CMapNode)ftcnode;    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;    FT_UNUSED( cache );    if ( list_changed )      *list_changed = FALSE;    return FT_BOOL( node->face_id == face_id );  }
开发者ID:hamfirst,项目名称:StormBrewerEngine,代码行数:14,


示例14: ftc_gnode_compare

  ftc_gnode_compare( FTC_Node    ftcgnode,                     FT_Pointer  ftcgquery,                     FTC_Cache   cache,                     FT_Bool*    list_changed )  {    FTC_GNode   gnode  = (FTC_GNode)ftcgnode;    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;    FT_UNUSED( cache );    if ( list_changed )      *list_changed = FALSE;    return FT_BOOL( gnode->family == gquery->family &&                    gnode->gindex == gquery->gindex );  }
开发者ID:1nt3g3r,项目名称:libgdx,代码行数:15,


示例15: ftc_cmap_node_compare

  ftc_cmap_node_compare( FTC_Node    ftcnode,                         FT_Pointer  ftcquery,                         FTC_Cache   cache )  {    FTC_CMapNode   node  = (FTC_CMapNode)ftcnode;    FTC_CMapQuery  query = (FTC_CMapQuery)ftcquery;    FT_UNUSED( cache );    if ( node->face_id    == query->face_id    &&         node->cmap_index == query->cmap_index )    {      FT_UInt32  offset = (FT_UInt32)( query->char_code - node->first );      return FT_BOOL( offset < FTC_CMAP_INDICES_MAX );    }    return 0;  }
开发者ID:Aggroo,项目名称:nebula-trifid,代码行数:20,


示例16: ftc_basic_gnode_compare_faceid

  ftc_basic_gnode_compare_faceid( FTC_Node    ftcgnode,                                  FT_Pointer  ftcface_id,                                  FTC_Cache   cache )  {    FTC_GNode        gnode   = (FTC_GNode)ftcgnode;    FTC_FaceID       face_id = (FTC_FaceID)ftcface_id;    FTC_BasicFamily  family  = (FTC_BasicFamily)gnode->family;    FT_Bool          result;    result = FT_BOOL( family->attrs.scaler.face_id == face_id );    if ( result )    {      /* we must call this function to avoid this node from appearing       * in later lookups with the same face_id!       */      FTC_GNode_UnselectFamily( gnode, cache );    }    return result;  }
开发者ID:0x163mL,项目名称:phantomjs,代码行数:20,


示例17: ftc_cmap_family_compare

  ftc_cmap_family_compare( FTC_CMapFamily  cfam,                           FTC_CMapQuery   cquery )  {    FT_Int  result = 0;    /* first, compare face id and type */    if ( cfam->desc.face_id != cquery->desc->face_id ||         cfam->desc.type    != cquery->desc->type    )      goto Exit;    switch ( cfam->desc.type )    {    case FTC_CMAP_BY_INDEX:      result = ( cfam->desc.u.index == cquery->desc->u.index );      break;    case FTC_CMAP_BY_ENCODING:      result = ( cfam->desc.u.encoding == cquery->desc->u.encoding );      break;    case FTC_CMAP_BY_ID:      result = ( cfam->desc.u.id.platform == cquery->desc->u.id.platform &&                 cfam->desc.u.id.encoding == cquery->desc->u.id.encoding );      break;    default:      ;    }    if ( result )    {      /* when found, update the 'family' and 'hash' field of the query */      FTC_QUERY( cquery )->family = FTC_FAMILY( cfam );      FTC_QUERY( cquery )->hash   = FTC_CMAP_HASH( cfam, cquery );    }  Exit:    return FT_BOOL( result );  }
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:40,


示例18: ft_conic_is_small_enough

  static FT_Bool  ft_conic_is_small_enough( FT_Vector*  base,                            FT_Angle   *angle_in,                            FT_Angle   *angle_out )  {    FT_Vector  d1, d2;    FT_Angle   theta;    FT_Int     close1, close2;    d1.x = base[1].x - base[2].x;    d1.y = base[1].y - base[2].y;    d2.x = base[0].x - base[1].x;    d2.y = base[0].y - base[1].y;    close1 = FT_IS_SMALL( d1.x ) && FT_IS_SMALL( d1.y );    close2 = FT_IS_SMALL( d2.x ) && FT_IS_SMALL( d2.y );    if ( close1 )    {      if ( close2 )        *angle_in = *angle_out = 0;      else        *angle_in = *angle_out = FT_Atan2( d2.x, d2.y );    }    else if ( close2 )    {      *angle_in = *angle_out = FT_Atan2( d1.x, d1.y );    }    else    {      *angle_in  = FT_Atan2( d1.x, d1.y );      *angle_out = FT_Atan2( d2.x, d2.y );    }    theta = ft_pos_abs( FT_Angle_Diff( *angle_in, *angle_out ) );    return FT_BOOL( theta < FT_SMALL_CONIC_THRESHOLD );  }
开发者ID:gbarrand,项目名称:ArcheryTune,代码行数:39,


示例19: gxv_kern_coverage_classic_microsoft_validate

  static FT_Bool  gxv_kern_coverage_classic_microsoft_validate( FT_UShort      coverage,                                                FT_UShort*     format,                                                GXV_Validator  valid )  {    /* classic Microsoft-dialect */    FT_Bool  horizontal;    FT_Bool  minimum;    FT_Bool  cross_stream;    FT_Bool  override;    FT_UNUSED( valid );    /* reserved bits = 0 */    if ( coverage & 0xFDF0 )      return 0;    horizontal   = FT_BOOL(   coverage        & 1 );    minimum      = FT_BOOL( ( coverage >> 1 ) & 1 );    cross_stream = FT_BOOL( ( coverage >> 2 ) & 1 );    override     = FT_BOOL( ( coverage >> 3 ) & 1 );
开发者ID:CarloMaker,项目名称:Urho3D,代码行数:22,


示例20: cff_font_load

//.........这里部分代码省略.........      if ( FT_STREAM_SEEK( base_offset + dict->cid_fd_array_offset ) )        goto Exit;      error = cff_index_init( &fd_index, stream, 0 );      if ( error )        goto Exit;      if ( fd_index.count > CFF_MAX_CID_FONTS )      {        FT_ERROR(( "cff_font_load: FD array too large in CID font/n" ));        goto Fail_CID;      }      /* allocate & read each font dict independently */      font->num_subfonts = fd_index.count;      if ( FT_NEW_ARRAY( sub, fd_index.count ) )        goto Fail_CID;      /* set up pointer table */      for ( idx = 0; idx < fd_index.count; idx++ )        font->subfonts[idx] = sub + idx;      /* now load each subfont independently */      for ( idx = 0; idx < fd_index.count; idx++ )      {        sub = font->subfonts[idx];        error = cff_subfont_load( sub, &fd_index, idx,                                  stream, base_offset );        if ( error )          goto Fail_CID;      }      /* now load the FD Select array */      error = CFF_Load_FD_Select( &font->fd_select,                                  font->charstrings_index.count,                                  stream,                                  base_offset + dict->cid_fd_select_offset );    Fail_CID:      cff_index_done( &fd_index );      if ( error )        goto Exit;    }    else      font->num_subfonts = 0;    /* read the charstrings index now */    if ( dict->charstrings_offset == 0 )    {      FT_ERROR(( "cff_font_load: no charstrings offset!/n" ));      error = CFF_Err_Unknown_File_Format;      goto Exit;    }    /* explicit the global subrs */    font->num_global_subrs = font->global_subrs_index.count;    font->num_glyphs       = font->charstrings_index.count;    error = cff_index_get_pointers( &font->global_subrs_index,                                    &font->global_subrs ) ;    if ( error )      goto Exit;    /* read the Charset and Encoding tables if available */    if ( font->num_glyphs > 0 )    {      FT_Bool  invert = FT_BOOL( dict->cid_registry != 0xFFFFU && pure_cff );      error = cff_charset_load( &font->charset, font->num_glyphs, stream,                                base_offset, dict->charset_offset, invert );      if ( error )        goto Exit;      /* CID-keyed CFFs don't have an encoding */      if ( dict->cid_registry == 0xFFFFU )      {        error = cff_encoding_load( &font->encoding,                                   &font->charset,                                   font->num_glyphs,                                   stream,                                   base_offset,                                   dict->encoding_offset );        if ( error )          goto Exit;      }      else        /* CID-keyed fonts only need CIDs */        FT_FREE( font->charset.sids );    }    /* get the font name (/CIDFontName for CID-keyed fonts, */    /* /FontName otherwise)                                 */    font->font_name = cff_index_get_name( &font->name_index, face_index );  Exit:    return error;  }
开发者ID:Ali-il,项目名称:gamekit,代码行数:101,


示例21: pfr_face_init

  pfr_face_init( FT_Stream      stream,                 FT_Face        pfrface,                 FT_Int         face_index,                 FT_Int         num_params,                 FT_Parameter*  params )  {    PFR_Face  face = (PFR_Face)pfrface;    FT_Error  error;    FT_UNUSED( num_params );    FT_UNUSED( params );    /* load the header and check it */    error = pfr_header_load( &face->header, stream );    if ( error )      goto Exit;    if ( !pfr_header_check( &face->header ) )    {      FT_TRACE4(( "pfr_face_init: not a valid PFR font/n" ));      error = PFR_Err_Unknown_File_Format;      goto Exit;    }    /* check face index */    {      FT_UInt  num_faces;      error = pfr_log_font_count( stream,                                  face->header.log_dir_offset,                                  &num_faces );      if ( error )        goto Exit;      pfrface->num_faces = num_faces;    }    if ( face_index < 0 )      goto Exit;    if ( face_index >= pfrface->num_faces )    {      FT_ERROR(( "pfr_face_init: invalid face index/n" ));      error = PFR_Err_Invalid_Argument;      goto Exit;    }    /* load the face */    error = pfr_log_font_load(               &face->log_font, stream, face_index,               face->header.log_dir_offset,               FT_BOOL( face->header.phy_font_max_size_high != 0 ) );    if ( error )      goto Exit;    /* now load the physical font descriptor */    error = pfr_phy_font_load( &face->phy_font, stream,                               face->log_font.phys_offset,                               face->log_font.phys_size );    if ( error )      goto Exit;    /* now, set-up all root face fields */    {      PFR_PhyFont  phy_font = &face->phy_font;      pfrface->face_index = face_index;      pfrface->num_glyphs = phy_font->num_chars;      pfrface->face_flags = FT_FACE_FLAG_SCALABLE;      if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )        pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;      if ( phy_font->flags & PFR_PHY_VERTICAL )        pfrface->face_flags |= FT_FACE_FLAG_VERTICAL;      else        pfrface->face_flags |= FT_FACE_FLAG_HORIZONTAL;      if ( phy_font->num_strikes > 0 )        pfrface->face_flags |= FT_FACE_FLAG_FIXED_SIZES;      if ( phy_font->num_kern_pairs > 0 )        pfrface->face_flags |= FT_FACE_FLAG_KERNING;      /* If no family name was found in the "undocumented" auxiliary       * data, use the font ID instead.  This sucks but is better than       * nothing.       */      pfrface->family_name = phy_font->family_name;      if ( pfrface->family_name == NULL )        pfrface->family_name = phy_font->font_id;      /* note that the style name can be NULL in certain PFR fonts,       * probably meaning "Regular"       */      pfrface->style_name = phy_font->style_name;//.........这里部分代码省略.........
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:101,


示例22: pfr_slot_load

  pfr_slot_load( FT_GlyphSlot  pfrslot,         /* PFR_Slot */                 FT_Size       pfrsize,         /* PFR_Size */                 FT_UInt       gindex,                 FT_Int32      load_flags )  {    PFR_Slot     slot    = (PFR_Slot)pfrslot;    PFR_Size     size    = (PFR_Size)pfrsize;    FT_Error     error;    PFR_Face     face    = (PFR_Face)pfrslot->face;    PFR_Char     gchar;    FT_Outline*  outline = &pfrslot->outline;    FT_ULong     gps_offset;    if ( gindex > 0 )      gindex--;    /* check that the glyph index is correct */    FT_ASSERT( gindex < face->phy_font.num_chars );    /* try to load an embedded bitmap */    if ( ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) == 0 )    {      error = pfr_slot_load_bitmap( slot, size, gindex );      if ( error == 0 )        goto Exit;    }    if ( load_flags & FT_LOAD_SBITS_ONLY )    {      error = PFR_Err_Invalid_Argument;      goto Exit;    }    gchar               = face->phy_font.chars + gindex;    pfrslot->format     = FT_GLYPH_FORMAT_OUTLINE;    outline->n_points   = 0;    outline->n_contours = 0;    gps_offset          = face->header.gps_section_offset;    /* load the glyph outline (FT_LOAD_NO_RECURSE isn't supported) */    error = pfr_glyph_load( &slot->glyph, face->root.stream,                            gps_offset, gchar->gps_offset, gchar->gps_size );    if ( !error )    {      FT_BBox            cbox;      FT_Glyph_Metrics*  metrics = &pfrslot->metrics;      FT_Pos             advance;      FT_Int             em_metrics, em_outline;      FT_Bool            scaling;      scaling = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );      /* copy outline data */      *outline = slot->glyph.loader->base.outline;      outline->flags &= ~FT_OUTLINE_OWNER;      outline->flags |= FT_OUTLINE_REVERSE_FILL;      if ( size && pfrsize->metrics.y_ppem < 24 )        outline->flags |= FT_OUTLINE_HIGH_PRECISION;      /* compute the advance vector */      metrics->horiAdvance = 0;      metrics->vertAdvance = 0;      advance    = gchar->advance;      em_metrics = face->phy_font.metrics_resolution;      em_outline = face->phy_font.outline_resolution;      if ( em_metrics != em_outline )        advance = FT_MulDiv( advance, em_outline, em_metrics );      if ( face->phy_font.flags & PFR_PHY_VERTICAL )        metrics->vertAdvance = advance;      else        metrics->horiAdvance = advance;      pfrslot->linearHoriAdvance = metrics->horiAdvance;      pfrslot->linearVertAdvance = metrics->vertAdvance;      /* make-up vertical metrics(?) */      metrics->vertBearingX = 0;      metrics->vertBearingY = 0;      /* Apply the font matrix, if any.                 */      /* TODO: Test existing fonts with unusual matrix  */      /* whether we have to adjust Units per EM.        */      {        FT_Matrix font_matrix;        font_matrix.xx = face->log_font.matrix[0] << 8;        font_matrix.yx = face->log_font.matrix[1] << 8;        font_matrix.xy = face->log_font.matrix[2] << 8;        font_matrix.yy = face->log_font.matrix[3] << 8;        FT_Outline_Transform( outline, &font_matrix );//.........这里部分代码省略.........
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:101,


示例23: T1_Load_Glyph

  T1_Load_Glyph( FT_GlyphSlot  t1glyph,          /* T1_GlyphSlot */                 FT_Size       t1size,           /* T1_Size      */                 FT_UInt       glyph_index,                 FT_Int32      load_flags )  {    T1_GlyphSlot            glyph = (T1_GlyphSlot)t1glyph;    FT_Error                error;#ifdef __REACTOS__    T1_DecoderRec *decoder = malloc(sizeof(T1_DecoderRec));/* Ugly but it allows us to reduce the diff */#define decoder (*decoder)#else    T1_DecoderRec           decoder;#endif    T1_Face                 face = (T1_Face)t1glyph->face;    FT_Bool                 hinting;    T1_Font                 type1         = &face->type1;    PSAux_Service           psaux         = (PSAux_Service)face->psaux;    const T1_Decoder_Funcs  decoder_funcs = psaux->t1_decoder_funcs;    FT_Matrix               font_matrix;    FT_Vector               font_offset;    FT_Data                 glyph_data;    FT_Bool                 must_finish_decoder = FALSE;#ifdef FT_CONFIG_OPTION_INCREMENTAL    FT_Bool                 glyph_data_loaded = 0;#endif#ifdef FT_CONFIG_OPTION_INCREMENTAL    if ( glyph_index >= (FT_UInt)face->root.num_glyphs &&         !face->root.internal->incremental_interface   )#else    if ( glyph_index >= (FT_UInt)face->root.num_glyphs )#endif /* FT_CONFIG_OPTION_INCREMENTAL */    {      error = FT_THROW( Invalid_Argument );      goto Exit;    }    FT_TRACE1(( "T1_Load_Glyph: glyph index %d/n", glyph_index ));    FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );    if ( load_flags & FT_LOAD_NO_RECURSE )      load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;    if ( t1size )    {      glyph->x_scale = t1size->metrics.x_scale;      glyph->y_scale = t1size->metrics.y_scale;    }    else    {      glyph->x_scale = 0x10000L;      glyph->y_scale = 0x10000L;    }    t1glyph->outline.n_points   = 0;    t1glyph->outline.n_contours = 0;    hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&                       ( load_flags & FT_LOAD_NO_HINTING ) == 0 );    t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;    error = decoder_funcs->init( &decoder,                                 t1glyph->face,                                 t1size,                                 t1glyph,                                 (FT_Byte**)type1->glyph_names,                                 face->blend,                                 FT_BOOL( hinting ),                                 FT_LOAD_TARGET_MODE( load_flags ),                                 T1_Parse_Glyph );    if ( error )      goto Exit;    must_finish_decoder = TRUE;    decoder.builder.no_recurse = FT_BOOL(                                   ( load_flags & FT_LOAD_NO_RECURSE ) != 0 );    decoder.num_subrs     = type1->num_subrs;    decoder.subrs         = type1->subrs;    decoder.subrs_len     = type1->subrs_len;    decoder.buildchar     = face->buildchar;    decoder.len_buildchar = face->len_buildchar;    /* now load the unscaled outline */    error = T1_Parse_Glyph_And_Get_Char_String( &decoder, glyph_index,                                                &glyph_data );    if ( error )      goto Exit;#ifdef FT_CONFIG_OPTION_INCREMENTAL    glyph_data_loaded = 1;#endif    font_matrix = decoder.font_matrix;//.........这里部分代码省略.........
开发者ID:Strongc,项目名称:reactos,代码行数:101,


示例24: T1_Get_Private_Dict

//.........这里部分代码省略.........          break;        T1_Skip_Spaces  ( parser );        cur = parser->root.cursor;      }      /* we haven't found the correct `eexec'; go back and continue */      /* searching                                                  */      cur   = limit;      limit = parser->base_dict + parser->base_len;      goto Again;      /* now determine where to write the _encrypted_ binary private  */      /* dictionary.  We overwrite the base dictionary for disk-based */      /* resources and allocate a new block otherwise                 */    Found:      parser->root.limit = parser->base_dict + parser->base_len;      T1_Skip_PS_Token( parser );      cur   = parser->root.cursor;      limit = parser->root.limit;      /* According to the Type 1 spec, the first cipher byte must not be */      /* an ASCII whitespace character code (blank, tab, carriage return */      /* or line feed).  We have seen Type 1 fonts with two line feed    */      /* characters...  So skip now all whitespace character codes.      */      /*                                                                 */      /* On the other hand, Adobe's Type 1 parser handles fonts just     */      /* fine that are violating this limitation, so we add a heuristic  */      /* test to stop at /r only if it is not used for EOL.              */      pos_lf  = ft_memchr( cur, '/n', (size_t)( limit - cur ) );      test_cr = FT_BOOL( !pos_lf                                       ||                         pos_lf > ft_memchr( cur,                                             '/r',                                             (size_t)( limit - cur ) ) );      while ( cur < limit                    &&              ( *cur == ' '                ||                *cur == '/t'               ||                (test_cr && *cur == '/r' ) ||                *cur == '/n'               ) )        ++cur;      if ( cur >= limit )      {        FT_ERROR(( "T1_Get_Private_Dict:"                   " `eexec' not properly terminated/n" ));        error = FT_THROW( Invalid_File_Format );        goto Exit;      }      size = parser->base_len - (FT_ULong)( cur - parser->base_dict );      if ( parser->in_memory )      {        /* note that we allocate one more byte to put a terminating `0' */        if ( FT_ALLOC( parser->private_dict, size + 1 ) )          goto Fail;        parser->private_len = size;      }      else      {        parser->single_block = 1;        parser->private_dict = parser->base_dict;        parser->private_len  = size;
开发者ID:structuresound,项目名称:freetype,代码行数:67,


示例25: sfnt_load_face

sfnt_load_face(FT_Stream stream,               TT_Face face,               FT_Int face_index,               FT_Int num_params,               FT_Parameter * params){    FT_Error error;#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES    FT_Error psnames_error;#endif    FT_Bool has_outline;    FT_Bool is_apple_sbit;    FT_Bool ignore_preferred_family    = FALSE;    FT_Bool ignore_preferred_subfamily = FALSE;    SFNT_Service sfnt = (SFNT_Service)face->sfnt;    FT_UNUSED(face_index);    /* Check parameters */    {        FT_Int i;        for (i = 0; i < num_params; i++)        {            if (params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY)                ignore_preferred_family = TRUE;            else if (params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY)                ignore_preferred_subfamily = TRUE;        }    }    /* Load tables */    /* We now support two SFNT-based bitmapped font formats.  They */    /* are recognized easily as they do not include a `glyf'       */    /* table.                                                      */    /*                                                             */    /* The first format comes from Apple, and uses a table named   */    /* `bhed' instead of `head' to store the font header (using    */    /* the same format).  It also doesn't include horizontal and   */    /* vertical metrics tables (i.e. `hhea' and `vhea' tables are  */    /* missing).                                                   */    /*                                                             */    /* The other format comes from Microsoft, and is used with     */    /* WinCE/PocketPC.  It looks like a standard TTF, except that  */    /* it doesn't contain outlines.                                */    /*                                                             */    FT_TRACE2(("sfnt_load_face: %08p/n/n", face));    /* do we have outlines in there? */#ifdef FT_CONFIG_OPTION_INCREMENTAL    has_outline = FT_BOOL(face->root.internal->incremental_interface != 0 ||                          tt_face_lookup_table(face, TTAG_glyf) != 0 ||                          tt_face_lookup_table(face, TTAG_CFF) != 0);#else    has_outline = FT_BOOL(tt_face_lookup_table(face, TTAG_glyf) != 0 ||                          tt_face_lookup_table(face, TTAG_CFF) != 0);#endif    is_apple_sbit = 0;    /* if this font doesn't contain outlines, we try to load */    /* a `bhed' table                                        */    if (!has_outline && sfnt->load_bhed)    {        LOAD_(bhed);        is_apple_sbit = FT_BOOL(!error);    }    /* load the font header (`head' table) if this isn't an Apple */    /* sbit font file                                             */    if (!is_apple_sbit)    {        LOAD_(head);        if (error)            goto Exit;    }    if (face->header.Units_Per_EM == 0)    {        error = SFNT_Err_Invalid_Table;        goto Exit;    }    /* the following tables are often not present in embedded TrueType */    /* fonts within PDF documents, so don't check for them.            */    LOAD_(maxp);    LOAD_(cmap);    /* the following tables are optional in PCL fonts -- */    /* don't check for errors                            */    LOAD_(name);    LOAD_(post);//.........这里部分代码省略.........
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:101,


示例26: tt_face_get_name

static FT_Errortt_face_get_name(TT_Face face,                 FT_UShort nameid,                 FT_String **name){    FT_Memory       memory  = face->root.memory;    FT_Error        error   = SFNT_Err_Ok;    FT_String       *result = NULL;    FT_UShort       n;    TT_NameEntryRec *rec;    FT_Int          found_apple         = -1;    FT_Int          found_apple_roman   = -1;    FT_Int          found_apple_english = -1;    FT_Int          found_win           = -1;    FT_Int          found_unicode       = -1;    FT_Bool is_english = 0;    TT_NameEntry_ConvertFunc convert;    FT_ASSERT(name);    rec = face->name_table.names;    for (n = 0; n < face->num_names; n++, rec++)    {        /* According to the OpenType 1.3 specification, only Microsoft or  */        /* Apple platform IDs might be used in the `name' table.  The      */        /* `Unicode' platform is reserved for the `cmap' table, and the    */        /* `ISO' one is deprecated.                                        */        /*                                                                 */        /* However, the Apple TrueType specification doesn't say the same  */        /* thing and goes to suggest that all Unicode `name' table entries */        /* should be coded in UTF-16 (in big-endian format I suppose).     */        /*                                                                 */        if (rec->nameID == nameid && rec->stringLength > 0)        {            switch (rec->platformID)            {            case TT_PLATFORM_APPLE_UNICODE:            case TT_PLATFORM_ISO:                /* there is `languageID' to check there.  We should use this */                /* field only as a last solution when nothing else is        */                /* available.                                                */                /*                                                           */                found_unicode = n;                break;            case TT_PLATFORM_MACINTOSH:                /* This is a bit special because some fonts will use either    */                /* an English language id, or a Roman encoding id, to indicate */                /* the English version of its font name.                       */                /*                                                             */                if (rec->languageID == TT_MAC_LANGID_ENGLISH)                    found_apple_english = n;                else if (rec->encodingID == TT_MAC_ID_ROMAN)                    found_apple_roman = n;                break;            case TT_PLATFORM_MICROSOFT:                /* we only take a non-English name when there is nothing */                /* else available in the font                            */                /*                                                       */                if (found_win == -1 || (rec->languageID & 0x3FF) == 0x009)                {                    switch (rec->encodingID)                    {                    case TT_MS_ID_SYMBOL_CS:                    case TT_MS_ID_UNICODE_CS:                    case TT_MS_ID_UCS_4:                        is_english = FT_BOOL((rec->languageID & 0x3FF) == 0x009);                        found_win  = n;                        break;                    default:                        ;                    }                }                break;            default:                ;            }        }    }    found_apple = found_apple_roman;    if (found_apple_english >= 0)        found_apple = found_apple_english;    /* some fonts contain invalid Unicode or Macintosh formatted entries; */    /* we will thus favor names encoded in Windows formats if available   */    /* (provided it is an English name)                                   */    /*                                                                    */    convert = NULL;    if (found_win >= 0 && !(found_apple >= 0 && !is_english))    {//.........这里部分代码省略.........
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:101,


示例27: cff_slot_load

//.........这里部分代码省略.........          glyph->root.metrics.width  = (FT_Pos)metrics.width  << 6;          glyph->root.metrics.height = (FT_Pos)metrics.height << 6;          glyph->root.metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6;          glyph->root.metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6;          glyph->root.metrics.horiAdvance  = (FT_Pos)metrics.horiAdvance  << 6;          glyph->root.metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6;          glyph->root.metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6;          glyph->root.metrics.vertAdvance  = (FT_Pos)metrics.vertAdvance  << 6;          glyph->root.format = FT_GLYPH_FORMAT_BITMAP;          if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )          {            glyph->root.bitmap_left = metrics.vertBearingX;            glyph->root.bitmap_top  = metrics.vertBearingY;          }          else          {            glyph->root.bitmap_left = metrics.horiBearingX;            glyph->root.bitmap_top  = metrics.horiBearingY;          }          /* compute linear advance widths */          (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 0,                                                           glyph_index,                                                           &dummy,                                                           &advance );          glyph->root.linearHoriAdvance = advance;          has_vertical_info = FT_BOOL(                                face->vertical_info                   &&                                face->vertical.number_Of_VMetrics > 0 );          /* get the vertical metrics from the vmtx table if we have one */          if ( has_vertical_info )          {            (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1,                                                             glyph_index,                                                             &dummy,                                                             &advance );            glyph->root.linearVertAdvance = advance;          }          else          {            /* make up vertical ones */            if ( face->os2.version != 0xFFFFU )              glyph->root.linearVertAdvance = (FT_Pos)                ( face->os2.sTypoAscender - face->os2.sTypoDescender );            else              glyph->root.linearVertAdvance = (FT_Pos)                ( face->horizontal.Ascender - face->horizontal.Descender );          }          return error;        }      }    }#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */    /* return immediately if we only want the embedded bitmaps */    if ( load_flags & FT_LOAD_SBITS_ONLY )
开发者ID:93i,项目名称:godot,代码行数:67,


示例28: psh_blues_scale_zones

  /* reset the blues table when the device transform changes */  static void  psh_blues_scale_zones( PSH_Blues  blues,                         FT_Fixed   scale,                         FT_Pos     delta )  {    FT_UInt         count;    FT_UInt         num;    PSH_Blue_Table  table = 0;    /*                                                        */    /* Determine whether we need to suppress overshoots or    */    /* not.  We simply need to compare the vertical scale     */    /* parameter to the raw bluescale value.  Here is why:    */    /*                                                        */    /*   We need to suppress overshoots for all pointsizes.   */    /*   At 300dpi that satisfies:                            */    /*                                                        */    /*      pointsize < 240*bluescale + 0.49                  */    /*                                                        */    /*   This corresponds to:                                 */    /*                                                        */    /*      pixelsize < 1000*bluescale + 49/24                */    /*                                                        */    /*      scale*EM_Size < 1000*bluescale + 49/24            */    /*                                                        */    /*   However, for normal Type 1 fonts, EM_Size is 1000!   */    /*   We thus only check:                                  */    /*                                                        */    /*      scale < bluescale + 49/24000                      */    /*                                                        */    /*   which we shorten to                                  */    /*                                                        */    /*      "scale < bluescale"                               */    /*                                                        */    /* Note that `blue_scale' is stored 1000 times its real   */    /* value, and that `scale' converts from font units to    */    /* fractional pixels.                                     */    /*                                                        */    /* 1000 / 64 = 125 / 8 */    if ( scale >= 0x20C49BAL )      blues->no_overshoots = FT_BOOL( scale < blues->blue_scale * 8 / 125 );    else      blues->no_overshoots = FT_BOOL( scale * 125 < blues->blue_scale * 8 );    /*                                                        */    /*  The blue threshold is the font units distance under   */    /*  which overshoots are suppressed due to the BlueShift  */    /*  even if the scale is greater than BlueScale.          */    /*                                                        */    /*  It is the smallest distance such that                 */    /*                                                        */    /*    dist <= BlueShift && dist*scale <= 0.5 pixels       */    /*                                                        */    {      FT_Int  threshold = blues->blue_shift;      while ( threshold > 0 && FT_MulFix( threshold, scale ) > 32 )        threshold--;      blues->blue_threshold = threshold;    }    for ( num = 0; num < 4; num++ )    {      PSH_Blue_Zone  zone;      switch ( num )      {      case 0:        table = &blues->normal_top;        break;      case 1:        table = &blues->normal_bottom;        break;      case 2:        table = &blues->family_top;        break;      default:        table = &blues->family_bottom;        break;      }      zone  = table->zones;      count = table->count;      for ( ; count > 0; count--, zone++ )      {        zone->cur_top    = FT_MulFix( zone->org_top,    scale ) + delta;        zone->cur_bottom = FT_MulFix( zone->org_bottom, scale ) + delta;        zone->cur_ref    = FT_MulFix( zone->org_ref,    scale ) + delta;        zone->cur_delta  = FT_MulFix( zone->org_delta,  scale );        /* round scaled reference position */        zone->cur_ref = FT_PIX_ROUND( zone->cur_ref );#if 0        if ( zone->cur_ref > zone->cur_top )//.........这里部分代码省略.........
开发者ID:gzwplato,项目名称:VersyPDF,代码行数:101,


示例29: T1_Load_Glyph

  T1_Load_Glyph( FT_GlyphSlot  t1glyph,          /* T1_GlyphSlot */                 FT_Size       t1size,           /* T1_Size      */                 FT_UInt       glyph_index,                 FT_Int32      load_flags )  {    T1_GlyphSlot            glyph = (T1_GlyphSlot)t1glyph;    FT_Error                error;#ifdef __REACTOS__    T1_DecoderRec *decoder = malloc(sizeof(T1_DecoderRec));    if (!decoder)      return FT_THROW( Out_Of_Memory );/* Ugly but it allows us to reduce the diff */#define decoder (*decoder)    {#else    T1_DecoderRec           decoder;#endif    T1_Face                 face = (T1_Face)t1glyph->face;    FT_Bool                 hinting;    FT_Bool                 scaled;    FT_Bool                 force_scaling = FALSE;    T1_Font                 type1         = &face->type1;    PSAux_Service           psaux         = (PSAux_Service)face->psaux;    const T1_Decoder_Funcs  decoder_funcs = psaux->t1_decoder_funcs;    FT_Matrix               font_matrix;    FT_Vector               font_offset;    FT_Data                 glyph_data;    FT_Bool                 must_finish_decoder = FALSE;#ifdef FT_CONFIG_OPTION_INCREMENTAL    FT_Bool                 glyph_data_loaded = 0;#endif#ifdef FT_CONFIG_OPTION_INCREMENTAL    if ( glyph_index >= (FT_UInt)face->root.num_glyphs &&         !face->root.internal->incremental_interface   )#else    if ( glyph_index >= (FT_UInt)face->root.num_glyphs )#endif /* FT_CONFIG_OPTION_INCREMENTAL */    {      error = FT_THROW( Invalid_Argument );      goto Exit;    }    FT_TRACE1(( "T1_Load_Glyph: glyph index %d/n", glyph_index ));    FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );    if ( load_flags & FT_LOAD_NO_RECURSE )      load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;    if ( t1size )    {      glyph->x_scale = t1size->metrics.x_scale;      glyph->y_scale = t1size->metrics.y_scale;    }    else    {      glyph->x_scale = 0x10000L;      glyph->y_scale = 0x10000L;    }    t1glyph->outline.n_points   = 0;    t1glyph->outline.n_contours = 0;    hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&                       ( load_flags & FT_LOAD_NO_HINTING ) == 0 );    scaled  = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 );    glyph->hint     = hinting;    glyph->scaled   = scaled;    t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;    error = decoder_funcs->init( &decoder,                                 t1glyph->face,                                 t1size,                                 t1glyph,                                 (FT_Byte**)type1->glyph_names,                                 face->blend,                                 FT_BOOL( hinting ),                                 FT_LOAD_TARGET_MODE( load_flags ),                                 T1_Parse_Glyph );    if ( error )      goto Exit;    must_finish_decoder = TRUE;    decoder.builder.no_recurse = FT_BOOL(                                   ( load_flags & FT_LOAD_NO_RECURSE ) != 0 );    decoder.num_subrs     = type1->num_subrs;    decoder.subrs         = type1->subrs;    decoder.subrs_len     = type1->subrs_len;    decoder.subrs_hash    = type1->subrs_hash;    decoder.buildchar     = face->buildchar;    decoder.len_buildchar = face->len_buildchar;    /* now load the unscaled outline *///.........这里部分代码省略.........
开发者ID:Moteesh,项目名称:reactos,代码行数:101,


示例30: afm_parser_read_vals

  afm_parser_read_vals( AFM_Parser  parser,                        AFM_Value   vals,                        FT_UInt     n )  {    AFM_Stream  stream = parser->stream;    char*       str;    FT_UInt     i;    if ( n > AFM_MAX_ARGUMENTS )      return 0;    for ( i = 0; i < n; i++ )    {      FT_Offset  len;      AFM_Value  val = vals + i;      if ( val->type == AFM_VALUE_TYPE_STRING )        str = afm_stream_read_string( stream );      else        str = afm_stream_read_one( stream );      if ( !str )        break;      len = AFM_STREAM_KEY_LEN( stream, str );      switch ( val->type )      {      case AFM_VALUE_TYPE_STRING:      case AFM_VALUE_TYPE_NAME:        {          FT_Memory  memory = parser->memory;          FT_Error   error;          if ( !FT_QALLOC( val->u.s, len + 1 ) )          {            ft_memcpy( val->u.s, str, len );            val->u.s[len] = '/0';          }        }        break;      case AFM_VALUE_TYPE_FIXED:        val->u.f = PS_Conv_ToFixed( (FT_Byte**)(void*)&str,                                    (FT_Byte*)str + len, 0 );        break;      case AFM_VALUE_TYPE_INTEGER:        val->u.i = PS_Conv_ToInt( (FT_Byte**)(void*)&str,                                  (FT_Byte*)str + len );        break;      case AFM_VALUE_TYPE_BOOL:        val->u.b = FT_BOOL( len == 4                      &&                            !ft_strncmp( str, "true", 4 ) );        break;      case AFM_VALUE_TYPE_INDEX:        if ( parser->get_index )          val->u.i = parser->get_index( str, len, parser->user_data );        else          val->u.i = 0;        break;      }    }    return i;  }
开发者ID:CarloMaker,项目名称:Urho3D,代码行数:71,



注:本文中的FT_BOOL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ FT_CMAP_FACE函数代码示例
C++ FT_ASSERT函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。