Anonymous avatar Anonymous committed 155aea6

Fixed unicode in freetype example.

Comments (0)

Files changed (1)

examples/freetype/sdlfont.py

     font.render("or BLAND!", pygame2.Color(0, 0xCC, 28, 128), ptsize=64,
                 dest=(screen, 258, 237))
 
-    font.render("I \u2665 Unicode", pygame2.Color(0, 0xCC, 0xDD), ptsize=64,
+    text = "I \u2665 Unicode"
+    if sys.version_info[0] < 3:
+        text = "I " + unichr(0x2665) + " Unicode"
+    font.render(text, pygame2.Color(0, 0xCC, 0xDD), ptsize=64,
                 dest=(screen, 298, 320))
-
-    font.render("\u2665", colors["grey_light"], colors["red"], ptsize=148,
+    
+    text = "\u2665"
+    if sys.version_info[0] < 3:
+        text = unichr(0x2665)
+    font.render(text, colors["grey_light"], colors["red"], ptsize=148,
                 dest=(screen, 480, 32))
 
     font.render("...yes, this is a SDL surface", pygame2.Color(0, 0, 0),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.