GlyphData.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. function GlyphData() {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.GlyphData()
  4. }
  5. Object.defineProperties(this, {
  6. 'num_glyphs': { enumerable: true, configurable: true, get: GlyphData.prototype.__get_num_glyphs, set: GlyphData.prototype.__set_num_glyphs},
  7. 'trailingAdvance': { enumerable: true, configurable: true, get: GlyphData.prototype.__get_trailingAdvance, set: GlyphData.prototype.__set_trailingAdvance}
  8. })
  9. }
  10. GlyphData.prototype.__get_num_glyphs = function() {
  11. var retVal = new FT_UInt("__skip_ptr__")
  12. retVal.__ptr = Polycode.GlyphData__get_num_glyphs(this.__ptr)
  13. return retVal
  14. }
  15. GlyphData.prototype.__set_num_glyphs = function(val) {
  16. Polycode.GlyphData__set_num_glyphs(this.__ptr, val.__ptr)
  17. }
  18. GlyphData.prototype.__get_trailingAdvance = function() {
  19. return Polycode.GlyphData__get_trailingAdvance(this.__ptr)
  20. }
  21. GlyphData.prototype.__set_trailingAdvance = function(val) {
  22. Polycode.GlyphData__set_trailingAdvance(this.__ptr, val)
  23. }
  24. Duktape.fin(GlyphData.prototype, function (x) {
  25. if (x === GlyphData.prototype) {
  26. return;
  27. }
  28. Polycode.GlyphData__delete(x.__ptr)
  29. })
  30. GlyphData.prototype.clearData = function() {
  31. Polycode.GlyphData_clearData(this.__ptr)
  32. }