To answer some of my own questions...
1 - Some is in Compose.jl, but it's not all exposed, and I think I need the
lower level details so I am bumbling ahead.
2 - I've made things strongly typed as I suggested and then the Cairo.jl
naming became clearer - it omits nouns that are implied by type, I think,
which is what I had somehow changed into "pulling verbs to the front", so
names are now (with typed arguments) shorter and also more consistent.
But I still have no idea why \040 is appearing in some text.
Andrew
PS git repo updated so following earlier links will show new code as I
linked to head.
On Sunday, 13 September 2015 13:54:07 UTC-3, andrew cooke wrote:
>
>
> I thought it might be better to ask here that make an issue on Cairo.jl
> but I can do that instead if necessary.
>
> I am adding calls to the pango text API and have some questions:
>
> 1 - How did people manage without these? Is everyone using the Cairo
> "toy" API? Or have I missed some already existing interface?
>
> 2 - If this is needed, then:
>
> 2a - Is my renaming of functions OK (I have systematically pulled the verb
> to the front)?
>
> 2b - Is my handling of memory management OK (I have copied arrays of
> (persistent?) pointers so I can free memory within the routine that
> allocated it; I am calling Libc.free instead of g_free)?
>
> 2c - I strongly feel these should be more typesafe than they are right
> now. Should I do that by (for example) "immutable FontFamily p Ptr{Void}
> end" or is there some other preferred approach)?
>
> 3 - What's with the \040 in my bytestrings? See output below.
>
> The code is at
> https://github.com/andrewcooke/Drawing.jl/blob/master/src/cairo.jl and is
> incomplete. I'm asking now because I'm starting to worry about type safety
> and don't want to have to rewrite a bunch of code if this should be folded
> into Cairo.jl later.
>
> Finally, here is partial output from
> https://github.com/andrewcooke/Drawing.jl/blob/master/test/experiments/list_fonts.jl
>
> (see 3 above - why the \040?)
>
> ...
> Droid Sans Tamil false
> Regular
> Bold
> Italic
> Bold Italic
> TeX\040tipass8 false
> \040Regular
> Italic
> Bold
> Bold Italic
> TeX\040tipass9 false
> \040Regular
> Italic
> Bold
> Bold Italic
> ...
>
> Thanks,
> Andrew
>