Cfnt.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  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 along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. #ifndef CFNT_H
  19. #define CFNT_H
  20. //====================
  21. #ifdef PATHS_IN_INCLUDES
  22. #include "GREEN/BLiT/BLIT.H"
  23. #include "GREEN/BLiT/_BlitInt.H"
  24. #else
  25. #include "BLIT.H"
  26. #include "_BlitInt.H"
  27. #endif
  28. //====================
  29. // This class is used to hold the information for
  30. // a font. Actual printing
  31. // is done at a higher level by RPrint.
  32. // It will support kerning information.
  33. // Cell dimensions are in pixels.
  34. // Fonts are stored in a singly linked list, largest first.
  35. class RFont
  36. {
  37. public:
  38. //---------------
  39. RFont();
  40. ~RFont();
  41. void EraseAll();
  42. //---------------
  43. //---------------
  44. class RFontSet
  45. {
  46. public:
  47. //---------------
  48. RFontSet();
  49. ~RFontSet(); // free associated images...
  50. //---------------
  51. RImage** m_ppimCharacters; // FSPR1 has all kerning info inside
  52. short m_sCellHeight;
  53. short m_sMaxWidth;
  54. RFontSet* m_pNext;
  55. };
  56. //--------------- USER STUFF
  57. short Save(char* pszFileName);
  58. short Save(RFile* pcf);
  59. short Load(char* pszFileName);
  60. short Load(RFile* pcf);
  61. //--------------- UTILITY STUFF
  62. short Add(char* pszFileName);
  63. short Add(RFile* pcf);
  64. short AddLetter(RImage* pimLetter, // if FSPR1, don't need other arguements
  65. short sASCII=-1,short sKernL=0,short sKernR=0);
  66. // pdScale will be <= 1.0
  67. RFontSet* FindSize(short sCellH,double *pdScale);
  68. short DeleteSet(RFontSet* pRemove); // will NOT delete the last FontSet!
  69. //---------------
  70. short m_sMaxCellHeight;
  71. short m_sMaxCellWidth;
  72. short m_sNumberOfScales;
  73. RFontSet* m_pFontSets;
  74. };
  75. //====================
  76. #endif