Git Product home page Git Product logo

Comments (7)

avalanche123 avatar avalanche123 commented on July 22, 2024

Gravity is nice, I didn't implement it because gd doesn't support anything like it, however, now that I think about it, I think it could be fairly easy faked for gd driver as well, we'd just have to calculate positioning ourselves. I wouldn't call it gravity in Imagine though, more like text alignement, and I would make it Fron property, and add several FontInterface constants e.g. FontInterface::TOP_LEFT, FontInterface::CENTER, FontInterface::TOP_MIDDLE, etc.
And wrapping text sounds interesting as well, so feel free to work on those and submit pull requests, I will share my thoughts

from imagine.

tarnfeld avatar tarnfeld commented on July 22, 2024

Any news on this font alignment idea? :)

from imagine.

benlumley avatar benlumley commented on July 22, 2024

Despite it being a year, I've not looked at it... oops!

And from a quick look at the code, doesn't appear to have been implemented, at least not in the way suggested above.

from imagine.

avalanche123 avatar avalanche123 commented on July 22, 2024

Font alignment has not been implemented, that is correct.

from imagine.

avalanche123 avatar avalanche123 commented on July 22, 2024

closing for the lack of activity

from imagine.

crisu83 avatar crisu83 commented on July 22, 2024

Hello,

Text align can be done manually by querying the font width through Font::box and calculating the offset. Just thought I'd mentioned it here for further reference.

@avalanche123 would it be possible to have this support when drawing text through your API?

from imagine.

romainneutron avatar romainneutron commented on July 22, 2024

@crisu83 feel free to submit a PR for such enhancement

from imagine.

Related Issues (20)

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.