Giter Site home page Giter Site logo

Comments (6)

g-zachar avatar g-zachar commented on August 25, 2024

Hi @SatadruBhattacharjee

can you explain exactly what you mean by RTL texture?

Best regards

from lightning.

SatadruBhattacharjee avatar SatadruBhattacharjee commented on August 25, 2024

Hi @g-zachar,
The requirement is to have an RTL layout (Right-to-Left). For example, tried this approach but it's not doing anything.

` const TEXT = "This text is normal.\nThis text is bold.\nThis text is italic.\nThis text is <color=0xffcc2222>red.\nThis text is brokennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn up.\n"

    window.onload = function() {
        class BasicUsageExample extends lng.Application {
            static _template() {
                return {
                    text: {
                        w: 500,
                        wordBreak: true,
                        advancedRenderer: true,
                        text: TEXT
                    }
                }
            }
        }

        const options = {stage: {w: 900, h: 900, clearColor: 0xFF000000, canvas2d: true, useImageWorker: false}, debug: true}

        const app = new BasicUsageExample(options);
        const stage = app.stage;
        stage.direction = 'rtl';
        const canvas = stage.getCanvas();
        canvas.dir = 'rtl';
        console.log(canvas)
        // const ctx = canvas.getContext("2d");
        // ctx.direction = "rtl";

        document.body.appendChild(canvas);
    }`

from lightning.

g-zachar avatar g-zachar commented on August 25, 2024

@SatadruBhattacharjee

Unfortunately, currently there is no support for right-to-left component layout or text layout in Lightning.

Best regards

from lightning.

SatadruBhattacharjee avatar SatadruBhattacharjee commented on August 25, 2024

Thanks for your message @g-zachar , any plan to support RTL in V3 ?

from lightning.

erikhaandrikman avatar erikhaandrikman commented on August 25, 2024

We will put this feature on the backlog

from lightning.

frank-weindel avatar frank-weindel commented on August 25, 2024

@SatadruBhattacharjee I'm not sure if this is helpful or not, but have you tried using Unicode Bidirectional control characters to get what you are trying to achieve in Lightning 2.0?

Here's an example from our new Lightning Playground.

from lightning.

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.