Skip to content

Instantly share code, notes, and snippets.

@G4MR
Created March 24, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save G4MR/7e52c4d08d355b6f23e0 to your computer and use it in GitHub Desktop.
Save G4MR/7e52c4d08d355b6f23e0 to your computer and use it in GitHub Desktop.
method getSurface*(self: Font; text_type, render_type: string): SurfacePtr =
case render_type:
of "utf8":
case text_type:
of "shade":
ttf.renderUtf8Shaded(self.font_ptr, self.text, self.color, self.bg_color)
of "solid":
ttf.renderUtf8Solid(self.font_ptr, self.text, self.color)
of "blendwrap":
ttf.renderUtf8BlendedWrapped(self.font_ptr, self.text, self.color, self.wrap_length)
else:
ttf.renderUtf8Blended(self.font_ptr, self.text, self.color)
else:
case text_type:
of "shade":
ttf.renderTextShaded(self.font_ptr, self.text, self.color, self.bg_color)
of "solid":
ttf.renderTextSolid(self.font_ptr, self.text, self.color)
of "blendwrap":
echo "blendwrap"
ttf.renderTextBlendedWrapped(self.font_ptr, self.text, self.color, self.wrap_length)
else:
ttf.renderTextBlended(self.font_ptr, self.text, self.color)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment