Coder Social home page Coder Social logo

Comments (10)

Wikunia avatar Wikunia commented on May 19, 2024 1

I made a PR in Cairo to get the font matrix. If that works, I'll probably make a PR in Luxor to get the font size. JuliaGraphics/Cairo.jl#331

from javis.jl.

cormullion avatar cormullion commented on May 19, 2024

Good question. There are two text systems in Cairo: the Toy Api and the Other Api. Neither are that well supported - ie there are lots of Cairo functions that aren't yet implemented, and Cairo.jl has this odd pango business. I've given up trying to understand how it all works.

You will probably want to keep track of a font size and then specify it at the last moment...?

from javis.jl.

Wikunia avatar Wikunia commented on May 19, 2024

I would like to have functions getfontsize and gethue or something like that. Such that for our own functions we can access what was recently set. Several options: have that saved in the current drawing inside Luxor itself or build new functions to have it inside Javis or trying to look deeper into Cairo to get it from them.

from javis.jl.

cormullion avatar cormullion commented on May 19, 2024

Ah, there's a get color function already - I had the same problem trying to get the current color, so there's this https://github.com/JuliaGraphics/Luxor.jl/blob/9938a58161fc815d3937cb77767ed1eb3d6c3f89/src/basics.jl#L466 - not exported, though.

I wish you'd been around in 2014/15... :)

from javis.jl.

Wikunia avatar Wikunia commented on May 19, 2024

Ah okay that's nice. Then I only need it for font size I guess.

Back then I worked on Javascript stuff I guess. Not sure whether I was aware of Julia back then. Probably not.

from javis.jl.

Wikunia avatar Wikunia commented on May 19, 2024

Okay there is: https://www.cairographics.org/manual/cairo-text.html#cairo-get-font-matrix
which is currently not part of Cairo.jl

from javis.jl.

Wikunia avatar Wikunia commented on May 19, 2024

Btw you might be interested in #24 as well, as this is related to the colors being part of a layer.

from javis.jl.

cormullion avatar cormullion commented on May 19, 2024

Great! I think there's lots of room for getting more powerful text features in - can you remember to document the "toy api"/"pro api" aspects of anything new, because it's very confusing when one tries to mix them. For example, text_extents() only works with the toy api, which cost me quite a few minutes of puzzlement once ... :)

from javis.jl.

Wikunia avatar Wikunia commented on May 19, 2024

I think I need to understand the difference between toy and pro first 😄 I never got much into text before. I'll try to figure it out the next days.

from javis.jl.

Wikunia avatar Wikunia commented on May 19, 2024

Can be used forlatex once JuliaGraphics/Luxor.jl#104 is merged and when Cairo and Luxor tag a new release 😄

from javis.jl.

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.