GithubHelp home page GithubHelp logo

PangoAttribute support about pango HOT 17 CLOSED

RazrFalcon avatar RazrFalcon commented on July 21, 2024
PangoAttribute support

from pango.

Comments (17)

GuillaumeGomez avatar GuillaumeGomez commented on July 21, 2024

It cannot be generated automatically, so manual binding required.

from pango.

RazrFalcon avatar RazrFalcon commented on July 21, 2024

Is it hard to do? From where can I start?

from pango.

GuillaumeGomez avatar GuillaumeGomez commented on July 21, 2024

It might be a bit tricky. The issue starts here because of the AttrClass. Once AttrClass is done, it should be quick.

from pango.

RazrFalcon avatar RazrFalcon commented on July 21, 2024

Does AttrClass can be autogenerated?

from pango.

GuillaumeGomez avatar GuillaumeGomez commented on July 21, 2024

Nope, that's the problem.

from pango.

GuillaumeGomez avatar GuillaumeGomez commented on July 21, 2024

If you're not too much into a hurry, I might be able to do it in the next hours after I'm done with my current task.

from pango.

RazrFalcon avatar RazrFalcon commented on July 21, 2024

Well, if it takes less that a month - i'm fine =)

from pango.

GuillaumeGomez avatar GuillaumeGomez commented on July 21, 2024

For the published crate, it might take a month. :D

But you'll be able to use the repository directly.

from pango.

RazrFalcon avatar RazrFalcon commented on July 21, 2024

Yep. git is fine for now.

from pango.

GuillaumeGomez avatar GuillaumeGomez commented on July 21, 2024

Ok, once #82 is merged, you'll have everything you need and even more.

from pango.

RazrFalcon avatar RazrFalcon commented on July 21, 2024

Thanks, but I can't figure out how to use it. I have:

let attr = pango::functions::attr_underline_new(pango::Underline::Single);

And now I have to insert it to the attributes list, which should look like:

    PangoAttrList *attr_list = pango_attr_list_new();
    
    PangoAttribute *attribute = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
    attribute->start_index = 0;
    attribute->end_index = -1;
    pango_attr_list_insert(attr_list, attribute);

    pango_layout_set_attributes(layout, attr_list);
    pango_attr_list_unref(attr_list);

But none of these methods are implemented.

from pango.

EPashkin avatar EPashkin commented on July 21, 2024

It different from that you say on start issue ;)
When AttrList added to generation, gir generate all needed functions (with need some const fixes).
Only need add manual setters for attribute fields to https://github.com/gtk-rs/pango/blob/master/src/attribute.rs.

from pango.

EPashkin avatar EPashkin commented on July 21, 2024

Hm. Seems pango_attr_list_insert and 3 others maybe need some manual implementation if don't works after const-configure.

from pango.

RazrFalcon avatar RazrFalcon commented on July 21, 2024

It different from that you say on start issue

I agree, but why I need Attr creating without using it =)

Only need add manual setters for attribute fields

But pango_layout_set_attributes is still commented out.

from pango.

EPashkin avatar EPashkin commented on July 21, 2024

It will be uncommented after generating AttrList

from pango.

RazrFalcon avatar RazrFalcon commented on July 21, 2024

I see. The gir stuff is still magic for me.

Should I create a new issue for this?

from pango.

GuillaumeGomez avatar GuillaumeGomez commented on July 21, 2024

Yes please. And this time specify everything you need. :)

from pango.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.