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

Scaled (and rotated?) text drawing #197

Open
stevesims opened this issue Apr 3, 2024 · 2 comments
Open

Scaled (and rotated?) text drawing #197

stevesims opened this issue Apr 3, 2024 · 2 comments

Comments

@stevesims
Copy link
Contributor

It would be nice to support scaled text drawing. Applying a factor to scale width and/or height of text when output would be good.

Unfortunately this functionality is not currently supported by vdp-gl.

A possible solution to this would be to support applying a transformation matrix to text drawing operations. This could allow for both scaling, and also rotation when drawing text. Transformation matrixes are being considered for bitmap plotting - this could potentially use a very similar approach.

NB rotation when drawing a complete string of text may require support within the VDP to understand drawing strings - currently text is drawn strictly one character at a time. Issues around rotating text are complex, and affect cursor position as well as just printing individual characters.

@stevesims
Copy link
Contributor Author

we now have transformed bitmap plotting. the basic mechanism for this could be replicated for glyph plotting

inside agon-vdp the main complexity is really cursor movement - ensuring that the cursor moves as appropriate/expected from character to character. as there is no underlying support for printing strings of glyphs as a singular block of text, this may result in slightly idiosyncratic cursor movement

@stevesims
Copy link
Contributor Author

The command VDU 23,0,&96,flags,bufferId; set a transform to be used by the graphics system.

The obvious thing to do here is to add a flag for "text" to this call. However as noted above there are complications here when it comes to cursor movement. One possibility could be to add a second flag to apply the transform to cursor movement too.

The VDP however now supports VDU 23, 0, &9B, bufferId; to print a buffer to the screen as a single string. We could have the transform apply only to this command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant