glyph.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2009 Openmoko Inc.
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef GLYPH_H
  18. #define GLYPH_H
  19. struct glyph {
  20. unsigned char width;
  21. unsigned char height;
  22. signed char top_bearing;
  23. unsigned int n_spacing_hints;
  24. char data[0];
  25. } __attribute__((packed));
  26. int buf_render_string(char *buf, const int font, int off_x, int off_y, char*, int len, int inverted);
  27. int render_string(const int font, int off_x, int off_y, char*, int len, int inverted);
  28. int render_string_right(const int font, int off_x, int off_y, char*, int len, int inverted);
  29. void render_glyph(int start_x, int start_y, const struct glyph *glyph, char *buf);
  30. int draw_glyphs_to_buf(const int font, int start_x, int start_y, const char *string, char *buf);
  31. int render_string_and_clear(const int font, int start_x,
  32. int start_y, char *string, int text_length, int inverted,
  33. int clear_start_x, int clear_start_y, int clear_end_x, int clear_end_y);
  34. #endif /* GLYPH_H */