Categorygithub.com/micaelalastor/nanovgo
modulepackage
0.0.0-20180823143346-d6e8631f65e3
Repository: https://github.com/micaelalastor/nanovgo.git
Documentation: pkg.go.dev

# README

NanoVGo

Pure golang implementation of NanoVG <https://github.com/memononen/nanovg>_. NanoVG is a vector graphics engine inspired by HTML5 Canvas API.

DEMO <https://shibukawa.github.io/nanovgo/>_

API Reference

See GoDoc <https://godoc.org/github.com/shibukawa/nanovgo>_

Porting Memo

  • Root folder .go files

    Ported from NanoVG.

  • fontstashmini/fontstash_mini.go

    Ported from fontstash <https://github.com/memononen/fontstash>_. It includes only needed functions.

  • fontstashmini/truetype

    Copy from https://github.com/TheOnly92/fontstash.go (Public Domain)

License

zlib license

Original (NanoVG) Author

  • Mikko Mononen <https://github.com/memononen>_

Author

  • Yoshiki Shibukawa <https://github.com/shibukawa>_

Contribution

  • Moriyoshi Koizumi
  • @hnakamur2
  • @mattn_jp
  • @hagat
  • @h_doxas
  • FSX

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

BoxGradient creates and returns a box gradient.
DegToRad converts degree to radian.
No description provided by the author
HSL returns color value specified by hue, saturation and lightness.
HSLA returns color value specified by hue, saturation and lightness and alpha.
IdentityMatrix makes the transform to identity matrix.
ImagePattern creates and returns an image patter.
LerpRGBA linearly interpolates from color c0 to c1, and returns resulting color value.
LinearGradient creates and returns a linear gradient.
MONO returns color value specified by intensity value.
MONOf returns color value specified by intensity value.
NewContext makes new NanoVGo context that is entry point of this API.
No description provided by the author
No description provided by the author
RadialGradient creates and returns a radial gradient.
RadToDeg converts radian to degree.
RGB returns a color value from red, green, blue values.
RGBA returns a color value from red, green, blue and alpha values.
RGBAf returns a color value from red, green, blue and alpha values.
RGBf returns a color value from red, green, blue values.
RotateMatrix makes the transform to rotate matrix.
ScaleMatrix makes the transform to scale matrix.
SkewXMatrix makes the transform to skew-x matrix.
SkewYMatrix makes the transform to skew-y matrix.
TranslateMatrix makes the transform to translation matrix matrix.

# Constants

AlignBaseline (default) is used for vertical align.
AlignBottom is used for vertical align.
AlignCenter is used for horizontal align.
AlignLeft (default) is used for horizontal align.
AlignMiddle is used for vertical align.
AlignRight is used for horizontal align.
AlignTop is used for vertical align.
AntiAlias sets NanoVGo to use AA.
Bevel is used for joint.
Butt is used for line cap (default value).
Clockwise specify Arc curve direction.
CounterClockwise specify Arc curve direction.
Debug shows OpenGL errors to console.
Hole keeps internal hole.
ImageFlippy flips (inverses) image in Y direction when rendered.
ImageGenerateMipmaps generates mipmaps during creation of the image.
ImageNoDelete don't delete from memory when removing image.
ImagePreMultiplied specifies image data has premultiplied alpha.
ImageRepeatX repeats image in X direction.
ImageRepeatY repeats image in X direction.
Kappa90 is length proportional to radius of a cubic bezier handle for 90deg arcs.).
Miter is used for joint (default value).
PI of float32.
Round is used for line cap and joint.
Solid fills internal hole.
Square is used for line cap.
StencilStrokes sets NanoVGo to use stencil buffer to draw strokes.

# Structs

Color utils Colors in NanoVGo are stored as unsigned ints in ABGR format.
Context is an entry point object to use NanoVGo API and created by NewContext() function.
No description provided by the author
No description provided by the author
GlyphPosition keeps glyph location information.
Paint structure represent paint information including gradient and image painting.
TextRow keeps row geometry information.

# Type aliases

Align is used for text location.
CreateFlags is used when NewContext() to create NanoVGo context.
Direction is used with Context.Arc.
No description provided by the author
No description provided by the author
No description provided by the author
ImageFlags is used for setting image object.
LineCap is used for line cap and joint.
TransformMatrix is a 2x3 matrix is represented as float[6].
Winding is used for changing filling strategy.