nrf_font.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright (c) 2016 Eran Duchan
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to deal
  5. * in the Software without restriction, including without limitation the rights
  6. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. * copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in all
  11. * copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  19. * SOFTWARE.
  20. */
  21. #ifndef NRF_FONT_H__
  22. #define NRF_FONT_H__
  23. #include "stdint.h"
  24. /** @file
  25. *
  26. * @defgroup nrf_font Font header
  27. * @{
  28. * @ingroup nrf_gfx
  29. *
  30. * @brief Generated font structures.
  31. */
  32. /**
  33. * @brief Font char information.
  34. */
  35. typedef struct
  36. {
  37. uint8_t widthBits; /**< Width in bits (or pixels) of the character. */
  38. uint16_t offset; /**< Offset of the character's bitmap, in bytes, into the FONT_INFO's data array. */
  39. }FONT_CHAR_INFO;
  40. /**
  41. * @brief Font descriptor.
  42. */
  43. typedef struct
  44. {
  45. uint8_t height; /**< Height in bits (or pixels), of the font's characters. */
  46. uint8_t startChar; /**< The first character in the font (e.g. in charInfo and data). */
  47. uint8_t endChar; /**< The last character in the font. */
  48. uint8_t spacePixels; /**< Number of pixels that the space character takes up. */
  49. const FONT_CHAR_INFO * charInfo; /**< Pointer to array of char information. */
  50. const uint8_t * data; /**< Pointer to a generated array of character visual representation. */
  51. }FONT_INFO;
  52. /** @} */
  53. #endif // NRF_FONT_H__