Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webgl: Support rendering underline attribute #2251

Closed
Tyriar opened this issue Jun 23, 2019 · 4 comments · Fixed by #3386
Closed

Webgl: Support rendering underline attribute #2251

Tyriar opened this issue Jun 23, 2019 · 4 comments · Fixed by #3386
Assignees
Labels
area/addon/webgl help wanted type/enhancement Features or improvements to existing features
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 23, 2019

Webgl addon added in #1790

@Tyriar Tyriar added type/enhancement Features or improvements to existing features help wanted area/addon/webgl labels Jun 23, 2019
@kamalesh0406
Copy link

Can you elaborate on what feature you need I cannot understand it 😅

@Tyriar
Copy link
Member Author

Tyriar commented Jun 24, 2019

Currently echo -e '\x1b[4mhello' will not print hello in underlined like the other renderers:

webgl:

Screen Shot 2019-06-24 at 7 02 01 AM

expected:

Screen Shot 2019-06-24 at 7 02 08 AM

This will also involve a little shader programming to draw the underlines on top of the background, under the text.

@ryanwarsaw
Copy link

ryanwarsaw commented Aug 20, 2019

@Tyriar another issue I've noticed is that font ligatures don't appear to work in the new renderer. Are these two issues similar? (in the sense they're not implemented?) I'm new to the project, would love to contribute - not sure where the best place to start would be!

@Tyriar
Copy link
Member Author

Tyriar commented Aug 20, 2019

@ryanwarsaw ligatures are broken with all renderers at the moment, We need to tweak the addon in #2318

Once that's done, for WebGL we would need to handle these:

public registerCharacterJoiner(handler: CharacterJoinerHandler): number {
return this._characterJoinerRegistry.registerCharacterJoiner(handler);
}
public deregisterCharacterJoiner(joinerId: number): boolean {
return this._characterJoinerRegistry.deregisterCharacterJoiner(joinerId);
}

In the WebGL renderer:

public registerCharacterJoiner(handler: (text: string) => [number, number][]): number {
return -1;
}
public deregisterCharacterJoiner(joinerId: number): boolean {
return false;
}

Right now they do nothing but they need to register/deregister and then be used when drawing the characters together and treat them as a simple glyph. For example if the addon says ">=" is a ligature, it should draw ">=" together in a single glyph and save it to the texture atlas like that, you might be able to leverage WelglChatAtlas.getRasterizedGlyphCombinedChar to do that.

You might be able to hack in the ligatures addon to get it to work of bring it into this repo (from https://github.com/xtermjs/xterm-addon-ligatures) to get started on this, it should be relatively easy to do #2318 if you want to give that a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/addon/webgl help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants