Skip to content

Cairo: Explore Quartz backend #92

@tinchodias

Description

@tinchodias

Some time ago I added a function call to create a Quartz surface, and it didn't seem to work. See: https://www.cairographics.org/manual/cairo-Quartz-Surfaces.html

Today, I migrated a C test from cairo repository to Pharo and I discovered it works when I write a PNG with the contents.

string := WideString with: (Character value: 16r1F642). "smily face"
extent := 100@50.
aSurface := AeCairoQuartzSurface
	  extent: extent
	  format: AeCairoSurfaceFormat argb32.
aContext := aSurface newContext.

"Draw outlined text with toy font selection"
aContext
	selectFont: 'Apple Color Emoji'
		slant: AeCairoFontSlant normal
		weight: AeCairoFontWeight normal;
	fontSize: extent y // 2;
	moveToX: extent x // 5 y: (2 * extent y) // 3;
	showText: string;
	showText: string.

aSurface writePngTo: ('QuartzTest', Time microsecondClockValue asString, '.png') asFileReference.

Image

To Do: Add it to the codebase.

Related to #91

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions