Visualize greek letters in a sketch

edited June 2017 in p5.js

If I try to put greek letters in the text() function like γ or δ it gives me an error. How could you solve this? Thanks!


  • edited June 2017 Answer ✓

    Maybe you've forgotten to add <meta charset=UTF-8> to the top of your HTML file? :-?

    See it online here:

    <meta charset=UTF-8>
    <script async src=></script>
     * UTF-8 Letters Test (v1.0.1)
     * GoToLoop (2016-Jun-10)
     * visualize-greek-letters-in-a-sketch#Item_1
    "use strict";
    function setup() {
      createCanvas(700, 250);
      textAlign(CENTER, CENTER).textSize(0x20);
      text('διχθαδίας κῆρας φερέμεν θανάτοιο τέλος δέ.\n' +
           'Бу́ря мгло́ю не́бо кро́ет, Ви́хри сне́жные крутя́;\n' + 
           '富士の風や扇にのせて江戸土産', width>>1, height>>1);
Sign In or Register to comment.