Font.js 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. function Font() {
  2. Object.defineProperties(this, {
  3. 'loaded': { enumerable: true, configurable: true, get: Font.prototype.__get_loaded, set: Font.prototype.__set_loaded}
  4. })
  5. }
  6. Font.prototype.__get_loaded = function() {
  7. return Polycode.Font__get_loaded(this.__ptr)
  8. }
  9. Font.prototype.__set_loaded = function(val) {
  10. Polycode.Font__set_loaded(this.__ptr, val)
  11. }
  12. Duktape.fin(Font.prototype, function (x) {
  13. if (x === Font.prototype) {
  14. return;
  15. }
  16. Polycode.Font__delete(x.__ptr)
  17. })
  18. Font.prototype.getFace = function() {
  19. var retVal = new FT_Face()
  20. retVal.__ptr = Polycode.Font_getFace(this.__ptr)
  21. return retVal
  22. }
  23. Font.prototype.isValid = function() {
  24. return Polycode.Font_isValid(this.__ptr)
  25. }
  26. Font.prototype.setFontName = function(fontName) {
  27. Polycode.Font_setFontName(this.__ptr, fontName)
  28. }
  29. Font.prototype.getFontName = function() {
  30. return Polycode.Font_getFontName(this.__ptr)
  31. }
  32. Font.prototype.getFontPath = function() {
  33. return Polycode.Font_getFontPath(this.__ptr)
  34. }