Fantom

 

abstract const class

gfx::GfxEnv

sys::Obj
  gfx::GfxEnv

@Js

GfxEnv models an implementation of the gfx graphics API.

Slots

curSource

static GfxEnv? cur(Bool checked := true)

Get the current thread's graphics environment. If no environment is active then throw Err or return null based on checked flag. The current environment is configured with the "gfx.env" Actor local.

fontAscentSource

abstract Int fontAscent(Font f)

Get ascent of this font for this environment. The ascent is the distance in pixels from baseline to top of chars, not including any leading area.

fontDescentSource

abstract Int fontDescent(Font f)

Get descent of this font for this environment. The descent is the distance in pixels from baseline to bottom of chars, not including any leading area.

fontHeightSource

abstract Int fontHeight(Font f)

Get height of this font for this environment. The height is the pixels is the sum of ascent, descent, and leading.

fontLeadingSource

abstract Int fontLeading(Font f)

Get leading of this font for this environment. The leading area is the distance in pixels above the ascent which may include accents and other marks.

fontWidthSource

abstract Int fontWidth(Font f, Str s)

Get the width of the string in pixels when painted with this font for this environment.

imageResizeSource

abstract Image imageResize(Image img, Size size)

Resize this image into a new image for this environment.

imageSizeSource

abstract Size imageSize(Image img)

Get the size of the image or 0,0 if not loaded yet for this environment.