Guest User

Untitled

a guest
May 28th, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.78 KB | None | 0 0
  1. struct Font {
  2. long ltr[130]; //an array of longs for each character
  3. char length[130]; //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, //", replaced by 0x81
  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, //<, replaced by 0x7F
  60. 29120, //=
  61. 139936, //>, replaced by 0x80
  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. 148552, //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. 43144, //<
  127. 139936, //>
  128. 184320, //"
  129. 50022784, //look of disapproval
  130. 496640000, //lenny face eye
  131. 138482222, //lenny face nose/mouth
  132. 4088, //sunglasses
  133. 3840, //*puts on sunglasses*
  134. 229376, //overline
  135. 693142620, //shrug face
  136. 0,
  137. 0,
  138. 0,
  139. 0,
  140. 0,
  141. 0,
  142. 0,
  143. 0,
  144. 0,
  145. 0,
  146. 0,
  147. 0,
  148. 0
  149.  
  150. },{ //lengths
  151. 3, //space
  152. 1, //!
  153. 3, //"
  154. 5, //#
  155. 5, //$
  156. 3, //%
  157. 4, //&
  158. 1, //'
  159. 2, //(
  160. 2, //)
  161. 3, //*
  162. 3, //+
  163. 1, //,
  164. 3, //-
  165. 1, //.
  166. 3, ///
  167. 3, //0
  168. 3, //1
  169. 3, //2
  170. 3, //3
  171. 3, //4
  172. 3, //5
  173. 3, //6
  174. 3, //7
  175. 3, //8
  176. 3, //9
  177. 1, //:
  178. 1, //;
  179. 3, //<
  180. 3, //=
  181. 3, //>
  182. 3, //?
  183. 5, //@
  184. 4, //A
  185. 4, //B
  186. 4, //C
  187. 4, //D
  188. 4, //E
  189. 4, //F
  190. 4, //G
  191. 4, //H
  192. 3, //I
  193. 4, //J
  194. 4, //K
  195. 4, //L
  196. 5, //M
  197. 4, //N
  198. 4, //O
  199. 4, //P
  200. 4, //Q
  201. 4, //R
  202. 4, //S
  203. 3, //T
  204. 4, //U
  205. 5, //V
  206. 5, //W
  207. 3, //X
  208. 3, //Y
  209. 4, //Z
  210. 2, //[
  211. 3, //backslash
  212. 2, //]
  213. 3, //^
  214. 3, //_
  215. 2, //`
  216. 3, //a
  217. 3, //b
  218. 3, //c
  219. 3, //d
  220. 3, //e
  221. 3, //f
  222. 3, //g
  223. 3, //h
  224. 1, //i
  225. 2, //j
  226. 3, //k
  227. 1, //l
  228. 5, //m
  229. 3, //n
  230. 3, //o
  231. 3, //p
  232. 3, //q
  233. 3, //r
  234. 2, //s
  235. 2, //t
  236. 3, //u
  237. 3, //v
  238. 5, //w
  239. 3, //x
  240. 3, //y
  241. 3, //z
  242. 3, //{
  243. 1, //|
  244. 3, //}
  245. 5, //~
  246. 3, //<
  247. 3, //>
  248. 3, //"
  249. 5, //look of disapproval
  250. 5, //lenny face eye
  251. 5, //lenny face nose/mouth
  252. 3, //sunglasses
  253. 3, //*puts on sunglasses*
  254. 3, //overline
  255. 5, //shrug face
  256. 0,
  257. 0,
  258. 0,
  259. 0,
  260. 0,
  261. 0
  262. }
  263. };
  264.  
  265. int dispStr(unsigned char* str, struct Font font, int x, int y, int strlen);
Add Comment
Please, Sign In to add comment