Liking cljdoc? Tell your friends :D
Clojure only.

com.blockether.vis.internal.awt-boot

One RUNTIME bootstrap for every Java2D user in vis (attachment conversion, the PIL shim, the matplotlib shim).

A native image inherits nothing from build time: a top-level (System/setProperty "java.awt.headless" ...) runs while the image is being BUILT and is gone by the time the binary starts, so the first createGraphics in a shipped vis dies with NoClassDefFoundError java/awt/event/InputEvent (the platform toolkit -- LWCToolkit on macOS -- loads because nothing said headless). The repair therefore has to happen at RUNTIME, exactly once, before the first Graphics2D call -- which is what ensure! is for.

One RUNTIME bootstrap for every Java2D user in vis (attachment conversion,
the PIL shim, the matplotlib shim).

A native image inherits nothing from build time: a top-level
`(System/setProperty "java.awt.headless" ...)` runs while the image is being
BUILT and is gone by the time the binary starts, so the first `createGraphics`
in a shipped `vis` dies with `NoClassDefFoundError java/awt/event/InputEvent`
(the platform toolkit -- LWCToolkit on macOS -- loads because nothing said
headless). The repair therefore has to happen at RUNTIME, exactly once, before
the first Graphics2D call -- which is what `ensure!` is for.
raw docstring

ensure!clj

(ensure!)

Force the headless/font bootstrap once. Returns true when AWT is usable. Call it before the FIRST Java2D operation on any code path a native binary can reach; it is idempotent and cheap after the first call.

Force the headless/font bootstrap once. Returns true when AWT is usable.
Call it before the FIRST Java2D operation on any code path a native binary
can reach; it is idempotent and cheap after the first call.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close