Skip to content

Instantly share code, notes, and snippets.

@hitme
Created March 11, 2018 07:09
Show Gist options
  • Save hitme/7af6a3e00d11b54392ffeb75e40a3178 to your computer and use it in GitHub Desktop.
Save hitme/7af6a3e00d11b54392ffeb75e40a3178 to your computer and use it in GitHub Desktop.

Revisions

  1. hitme created this gist Mar 11, 2018.
    7 changes: 7 additions & 0 deletions draw-characters
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import pygame

    pygame.init()
    text = "庞中华"
    font = pygame.font.Font("/path/to/庞中华行书.ttf", 25)
    rtext = font.render(text, True, (0, 0, 0), (255, 255, 255))
    pygame.image.save(rtext, "t.gif")