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 css_select_font_face_h_
  10. #define css_select_font_face_h_
  11.  
  12. #include <libcss/font_face.h>
  13.  
  14.  
  15. struct css_font_face_src {
  16.         lwc_string *location;
  17.         /*
  18.          * Bit allocations:
  19.          *
  20.          *    76543210
  21.          *  1 _fffffll  format | location type
  22.          */
  23.         uint8_t bits[1];
  24. };
  25.  
  26. struct css_font_face {
  27.         lwc_string *font_family;
  28.         css_font_face_src *srcs;
  29.         uint32_t n_srcs;
  30.        
  31.         /*
  32.          * Bit allocations:
  33.          *
  34.          *    76543210
  35.          *  1 __wwwwss  font-weight | font-style
  36.          */
  37.         uint8_t bits[1];
  38.        
  39.         css_allocator_fn alloc;
  40.         void *pw;
  41. };
  42.  
  43. css_error css__font_face_create(css_allocator_fn alloc, void *pw,
  44.                 css_font_face **result);
  45. css_error css__font_face_destroy(css_font_face *font_face);
  46.  
  47. css_error css__font_face_set_font_family(css_font_face *font_face,
  48.                 lwc_string *font_family);
  49.  
  50. css_error css__font_face_set_srcs(css_font_face *font_face,
  51.                 css_font_face_src *srcs, uint32_t n_srcs);
  52.  
  53. #endif
  54.