Git Product home page Git Product logo

Comments (5)

HawtinZeng avatar HawtinZeng commented on May 26, 2024

when i test selection in troika examples, there is differenct height between number/charcter and Chinese text, can u give me some suggestions to solve this problem, I wanna take part in your project.
image

from troika.

HawtinZeng avatar HawtinZeng commented on May 26, 2024

Currently i don't use the y value returned by getCaretAtPoint, instead , I align the origin of a plane mesh to the origin of Text, solve this problem, but it seems not perfect.
image

from troika.

HawtinZeng avatar HawtinZeng commented on May 26, 2024

Hi, @lojjic , I have complated a demo for in-place text editing, link, I wanna to contribute it to your repo, how do u think? And where I should put this text editing example in?

from troika.

lojjic avatar lojjic commented on May 26, 2024

Thanks for the report!

The caretTop and caretHeight are calculated here -- the difference is due to the Latin and Chinese font files containing different ascender/descender metrics. I'm open to changing how those values are chosen, if you know of a good reliable method that would make them match.

As for your example, I think keeping it external is best, it can stay on Stackblitz and maybe we can add a link to it in the documentation.

from troika.

HawtinZeng avatar HawtinZeng commented on May 26, 2024

I will append the demo link into the doc soon, and by the way, do u know how to calculate the font length before text.sync, i want to draw some lines and dots based on text length before drawing troika textπŸ˜‚πŸ˜‚

from troika.

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.