GlyphData.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. function GlyphData() {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.GlyphData()
  4. }
  5. Object.defineProperties(this, {
  6. 'glyphs': { enumerable: true, configurable: true, get: GlyphData.prototype.__get_glyphs, set: GlyphData.prototype.__set_glyphs},
  7. 'positions': { enumerable: true, configurable: true, get: GlyphData.prototype.__get_positions, set: GlyphData.prototype.__set_positions},
  8. 'num_glyphs': { enumerable: true, configurable: true, get: GlyphData.prototype.__get_num_glyphs, set: GlyphData.prototype.__set_num_glyphs},
  9. 'trailingAdvance': { enumerable: true, configurable: true, get: GlyphData.prototype.__get_trailingAdvance, set: GlyphData.prototype.__set_trailingAdvance}
  10. })
  11. }
  12. GlyphData.prototype.__get_glyphs = function() {
  13. var retVal = new FT_Glyph()
  14. retVal.__ptr = Polycode.GlyphData__get_glyphs(this.__ptr)
  15. return retVal
  16. }
  17. GlyphData.prototype.__set_glyphs = function(val) {
  18. Polycode.GlyphData__set_glyphs(this.__ptr, val.__ptr)
  19. }
  20. GlyphData.prototype.__get_positions = function() {
  21. var retVal = new FT_Vector()
  22. retVal.__ptr = Polycode.GlyphData__get_positions(this.__ptr)
  23. return retVal
  24. }
  25. GlyphData.prototype.__set_positions = function(val) {
  26. Polycode.GlyphData__set_positions(this.__ptr, val.__ptr)
  27. }
  28. GlyphData.prototype.__get_num_glyphs = function() {
  29. var retVal = new FT_UInt()
  30. retVal.__ptr = Polycode.GlyphData__get_num_glyphs(this.__ptr)
  31. return retVal
  32. }
  33. GlyphData.prototype.__set_num_glyphs = function(val) {
  34. Polycode.GlyphData__set_num_glyphs(this.__ptr, val.__ptr)
  35. }
  36. GlyphData.prototype.__get_trailingAdvance = function() {
  37. return Polycode.GlyphData__get_trailingAdvance(this.__ptr)
  38. }
  39. GlyphData.prototype.__set_trailingAdvance = function(val) {
  40. Polycode.GlyphData__set_trailingAdvance(this.__ptr, val)
  41. }
  42. Duktape.fin(GlyphData.prototype, function (x) {
  43. if (x === GlyphData.prototype) {
  44. return;
  45. }
  46. Polycode.GlyphData__delete(x.__ptr)
  47. })
  48. GlyphData.prototype.clearData = function() {
  49. Polycode.GlyphData_clearData(this.__ptr)
  50. }