Closed elder-n00b closed 1 year ago
The issue in the generated code is that the variable unicodes
uses itself during the initial definition:
# variable a does not exist yet
a = if a
1
end
The underlying issue is that gi-crystal does not really support (out)
arguments.
The function face_collect_nominal_glyph_mapping
actually wants three arguments face
, mapping
and unicodes
. But the last two arguments are (out)
arguments. That means that the arguments should be pointers to variables in which the resulting objects will be stores. In the case of unicodes
, you can even pass a null pointer to indicate that you do not want this object.
All this is quite complicated and not yet mapped to crystal world. So this issue probably won't be solved soon.
Well then, for now I put hb_face_collect_nominal_glyph_mapping
under lib_ignore
in ./lib/gtk4/src/bindings/harfbuzz/binding.yml
, that works around the error.
In case I want to try something about it, I start looking in ./src/generator/arg_strategy.cr
and method_gen.cr
right?
BTW I noticed that this function is already ignored in https://github.com/hugopl/harfbuzz.cr/blob/main/src/bindings/harfbuzz/binding.yml so it's already fixed in master
branch.
I just need to do a release then 😅
And yes, it's a duplicate of https://github.com/hugopl/gi-crystal/issues/53.
Anyway, thanks for trying the bindings and report the issue.
Very first time I try to use this, I may well be doing something wrong.
...
The syntax error code is this (in
./lib/gi-crystal/src/auto/harf_buzz-0.0/harf_buzz.cr
):but it looks correct to me, and I could not reproduce the syntax error with similar code by itself. Let me know if I should provide more info or do some tests, it's all a bit over my head but I want this to work and I have time on my hands.
edit: looks like it may be related to #53