Guest User

Untitled

a guest
Apr 22nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. struct Font {
  2. long ltr[105]; //an array of longs for each character
  3. char length[105]; //array of chars for the length of each character
  4. };
  5.  
  6. /*
  7.  
  8. Here is how a character is defined.
  9.  
  10. Each character is 6 pixels high. The length is defined by you in the length array.
  11.  
  12. For example, the character '0', of length 3, is the following in binary:
  13.  
  14. 111
  15. 101
  16. 101
  17. 101
  18. 111
  19. 000
  20.  
  21. You must not forget the "000" at the end, else your character will be shifted down by a pixel.
  22. Now just remove the newlines in the character. You should get: 111101101101111000
  23. Put that in a binary to decimal converter and you've got your number representing the character.
  24.  
  25. Also, make sure to define the correct length, else it will display gibberish.
  26.  
  27. */
  28.  
  29. struct Font normfont = {
  30. { //letters
  31. 0, //space
  32. 58, //!
  33. 184320, //"
  34. 368409920, //#
  35. 524752832, //$
  36. 136456, //%
  37. 6838992, //&
  38. 48, //'
  39. 1700, //(
  40. 2392, //)
  41. 174592, //*
  42. 11904, //+
  43. 3, //,
  44. 3584, //-
  45. 2, //.
  46. 38176, ///
  47. 252792, //0
  48. 206008, //1
  49. 237368, //2
  50. 235128, //3
  51. 187976, //4
  52. 249464, //5
  53. 249720, //6
  54. 234640, //7
  55. 253816, //8
  56. 253560, //9
  57. 10, //:
  58. 11, //;
  59. 43144, //<
  60. 29120, //=
  61. 139936, //>
  62. 201744, //?
  63. 488035776, //@
  64. 6922128, //A
  65. 15329760, //B
  66. 6916448, //C
  67. 15309280, //D
  68. 16312560, //E
  69. 16312448, //F
  70. 7911776, //G
  71. 10090896, //H
  72. 238776, //I
  73. 7480000, //J
  74. 10144400, //K
  75. 8947952, //L
  76. 599442976, //M
  77. 10336656, //N
  78. 6920544, //O
  79. 15310464, //P
  80. 6921072, //Q
  81. 15310480, //R
  82. 7889376, //S
  83. 238736, //T
  84. 10066288, //U
  85. 588818560, //V
  86. 588961088, //W
  87. 185704, //X
  88. 187024, //Y
  89. 15878384, //Z
  90. 3756, //[
  91. 545392672, //backslash
  92. 3420, //]
  93. 86016, //^
  94. 7, //_
  95. 3648, //`
  96. 15192, //a
  97. 158576, //b
  98. 14616, //c
  99. 47960, //d
  100. 15256, //e
  101. 118048, //f
  102. 15310, //g
  103. 158568, //h
  104. 46, //i
  105. 1111, //j
  106. 154984, //k
  107. 62, //l
  108. 27973280, //m
  109. 27496, //n
  110. 11088, //o
  111. 27508, //p
  112. 15193, //q
  113. 23840, //r
  114. 924, //s
  115. 2988, //t
  116. 23416, //u
  117. 23376, //v
  118. 18535744, //w
  119. 21864, //x
  120. 23246, //y
  121. 30008, //z
  122. 108696, //{
  123. 62, //|
  124. 205488, //}
  125. 448512, //~
  126.  
  127. },{ //lengths
  128. 3, //space
  129. 1, //!
  130. 3, //"
  131. 5, //#
  132. 5, //$
  133. 3, //%
  134. 4, //&
  135. 1, //'
  136. 2, //(
  137. 2, //)
  138. 3, //*
  139. 3, //+
  140. 1, //,
  141. 3, //-
  142. 1, //.
  143. 3, ///
  144. 3, //0
  145. 3, //1
  146. 3, //2
  147. 3, //3
  148. 3, //4
  149. 3, //5
  150. 3, //6
  151. 3, //7
  152. 3, //8
  153. 3, //9
  154. 1, //:
  155. 1, //;
  156. 3, //<
  157. 3, //=
  158. 3, //>
  159. 3, //?
  160. 5, //@
  161. 4, //A
  162. 4, //B
  163. 4, //C
  164. 4, //D
  165. 4, //E
  166. 4, //F
  167. 4, //G
  168. 4, //H
  169. 3, //I
  170. 4, //J
  171. 4, //K
  172. 4, //L
  173. 5, //M
  174. 4, //N
  175. 4, //O
  176. 4, //P
  177. 4, //Q
  178. 4, //R
  179. 4, //S
  180. 3, //T
  181. 4, //U
  182. 5, //V
  183. 5, //W
  184. 3, //X
  185. 3, //Y
  186. 4, //Z
  187. 2, //[
  188. 5, //backslash
  189. 2, //]
  190. 3, //^
  191. 3, //_
  192. 2, //`
  193. 3, //a
  194. 3, //b
  195. 3, //c
  196. 3, //d
  197. 3, //e
  198. 3, //f
  199. 3, //g
  200. 3, //h
  201. 1, //i
  202. 2, //j
  203. 3, //k
  204. 1, //l
  205. 5, //m
  206. 3, //n
  207. 3, //o
  208. 3, //p
  209. 3, //q
  210. 3, //r
  211. 2, //s
  212. 2, //t
  213. 3, //u
  214. 3, //v
  215. 5, //w
  216. 3, //x
  217. 3, //y
  218. 3, //z
  219. 3, //{
  220. 1, //|
  221. 3, //}
  222. 5 //~
  223. }
  224. };
  225.  
  226. int dispStr(char* str, struct Font font, int x, int y, int strlen);
Add Comment
Please, Sign In to add comment