Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * This file is part of LibCSS.
  3.  * Licensed under the MIT License,
  4.  *                http://www.opensource.org/licenses/mit-license.php
  5.  * Copyright 2011 Things Made Out Of Other Things Ltd.
  6.  * Written by James Montgomerie <jamie@th.ingsmadeoutofotherthin.gs>
  7.  */
  8.  
  9. #ifndef libcss_font_face_h_
  10. #define libcss_font_face_h_
  11.  
  12. #ifdef __cplusplus
  13. extern "C"
  14. {
  15. #endif
  16.  
  17. #include <libwapcaplet/libwapcaplet.h>
  18.        
  19. #include <libcss/errors.h>
  20. #include <libcss/functypes.h>
  21. #include <libcss/properties.h>
  22. #include <libcss/types.h>
  23.  
  24. typedef enum css_font_face_format {
  25.         CSS_FONT_FACE_FORMAT_UNSPECIFIED        = 0x00,
  26.  
  27.         CSS_FONT_FACE_FORMAT_WOFF               = 0x01,
  28.                 /* WOFF (Web Open Font Format); .woff */
  29.         CSS_FONT_FACE_FORMAT_OPENTYPE           = 0x02,
  30.                 /* TrueType or OpenType; .ttf, .otf */
  31.         CSS_FONT_FACE_FORMAT_EMBEDDED_OPENTYPE  = 0x04,
  32.                 /* Embedded OpenType; .eot */
  33.         CSS_FONT_FACE_FORMAT_SVG                = 0x08,
  34.                 /* SVG Font; .svg, .svgz */
  35.        
  36.         CSS_FONT_FACE_FORMAT_UNKNOWN            = 0x10,
  37.                 /* Format specified, but not recognised */
  38.        
  39.         /* We don't define CSS_FONT_FACE_SRC_FORMAT_TRUETYPE as might be
  40.          * expected, because the CSS3 specification
  41.          *  (http://www.w3.org/TR/css3-fonts/, ยง4.3) says:
  42.          *      "Given the overlap in common usage between TrueType and
  43.          *       OpenType, the format hints "truetype" and "opentype" must be
  44.          *       considered as synonymous"
  45.          * so we compute a hint of 'truetype' to css_font_face_format_opentype.
  46.          */
  47. } css_font_face_format;
  48.  
  49. typedef enum css_font_face_location_type {
  50.         CSS_FONT_FACE_LOCATION_TYPE_UNSPECIFIED = 0,
  51.         CSS_FONT_FACE_LOCATION_TYPE_LOCAL       = 1,
  52.         CSS_FONT_FACE_LOCATION_TYPE_URI         = 2,
  53. } css_font_face_location_type;
  54.  
  55.        
  56. css_error css_font_face_get_font_family(
  57.                 const css_font_face *font_face,
  58.                 lwc_string **font_family);
  59.                
  60. css_error css_font_face_count_srcs(const css_font_face *font_face,
  61.                 uint32_t *count);
  62. css_error css_font_face_get_src(const css_font_face *font_face, uint32_t index,
  63.                 const css_font_face_src **src);
  64.        
  65. css_error css_font_face_src_get_location(const css_font_face_src *src,
  66.                 lwc_string **location);
  67.        
  68. css_font_face_location_type css_font_face_src_location_type(
  69.                 const css_font_face_src *src);
  70. css_font_face_format css_font_face_src_format(const css_font_face_src *src);
  71.  
  72. uint8_t css_font_face_font_style(const css_font_face *font_face);
  73. uint8_t css_font_face_font_weight(const css_font_face *font_face);
  74.  
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78.  
  79. #endif
  80.