https://github.com/mrfearless/drawtextext
Extended DrawText function with html and bbcode support
https://github.com/mrfearless/drawtextext
assembly-language drawtext gdi masm masm32 radasm win32api x86
Last synced: 11 months ago
JSON representation
Extended DrawText function with html and bbcode support
- Host: GitHub
- URL: https://github.com/mrfearless/drawtextext
- Owner: mrfearless
- Created: 2018-08-25T15:50:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-31T16:48:08.000Z (almost 8 years ago)
- Last Synced: 2025-04-06T12:37:04.589Z (about 1 year ago)
- Topics: assembly-language, drawtext, gdi, masm, masm32, radasm, win32api, x86
- Language: Assembly
- Size: 3.11 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DrawTextEXT
Extended DrawText function with html and bbcode support
Adapted from DrawHTML code posted by Ukkie9: https://www.codeproject.com/Articles/7936/DrawHTML
[](http://www.masm32.com/download.htm) [](http://www.softpedia.com/get/Programming/File-Editors/RadASM.shtml)   [](https://www.buymeacoffee.com/mrfearless)
## Setup DrawTextEXT
* Download the latest version of the DrawTextEXT release and extract the files. The latest release can be found in the [releases](https://github.com/mrfearless/DrawTextEXT/tree/master/releases) folder, or can be downloaded directly from [here](https://github.com/mrfearless/DrawTextEXT/blob/master/releases/DrawTextEXT.zip?raw=true).
* Copy the `DrawTextEXT.inc` file to your project's folder
* Copy the `DrawTextEXT.asm` file to your project's folder
* Add the following to your project: `include DrawTextEXT.asm`
* Call the `DrawHTMLCODE` or `DrawBBCODE` function in your code, preferably in a control's `WM_PAINT` event.
## DrawTextEXT Supported Tags
**DrawHTMLCODE:**
The `DrawHTMLCODE` function supports the following html tags, enclosed in angle brackets `<>` for starting tags and `>` for ending tags:
* ` `, ` ` for bolding text
* ` `, ` ` for italic text
* ` ` for underlined text
* ` ` for subscript
* ` ` for superscript
* `
`, ` ` for preformatted text
* `
` for line breaks
* `` for paragraph breaks
* ` ` for color of text using a hex string
* ` ` for color of text using a hex string
* ` `, ` `, ` ` for block quotes
* `
* `
* `
* `
` for horizontal rule
* `title` for hyperlinks having a url and title
**Note:** Strings that include byte sequences of `13,10` (`0D,0Ah`) known as CRLF or `10` (`0Ah`) known as LF, **ARE IGNORED**. Use the `
` or `
` if you wish to break to a new line.
`` tag supports internal ids if prefixed with a `#`, for example:
```
Click on this link to show a message box
```
The url title text is shown as 'link' and the id as `#1010`. When the url is clicked, the id will be converted to an integer (`1010`) and send to the parent window via the `WM_COMMAND` message with the id integer stored in the high word of `wParam`
**DrawBBCODE:**
The `DrawBBCODE` function supports the following bbcode tags, enclosed in square brackets `[]` for starting tags and `[/]` for ending tags:
* `[b] [/b]`, ` ` for bolding text
* `[i] [/i]` for italic text
* `[u] [/u]` for underlined text
* `[code] [/code]` for preformatted text
* `[color=#RRGGBB] [/color]` for color of text using a hex string
* `[q] [/q]`,` [quote] [/quote]` for block quotes `*`
* `[ul] [/ul]` for unordered lists with bullets
* `[ol] [/ol]` for ordered lists with numbers
* `[li] [/li]` or `[*]` for list items within a list
* `[url] [/url]` for hyperlinks having a url and title
`*`Experimental/Not Complete
**Note:** There is no bbcode for line breaks or paragraph. Strings that include byte sequences of `13,10` (`0D,0Ah`) known as CRLF or `10` (`0Ah`) known as LF, are automatically processed to break to a new line.
`[url]` tag supports internal ids if prefixed with a `#`, for example:
```
Click on this [url=#1010]link[/url] to show a message box
```
The url title text is shown as 'link' and the id as `#1010`. When the url is clicked, the id will be converted to an integer (`1010`) and send to the parent window via the `WM_COMMAND` message with the id integer stored in the high word of `wParam`
## DrawTextEXT Demo
A RadASM example project is included to demonstrate the `DrawHTMLCODE` function. It can be found in the [releases](https://github.com/mrfearless/DrawTextEXT/tree/master/releases) folder, or can be downloaded directly from [here](https://github.com/mrfearless/DrawTextEXT/blob/master/releases/DrawHTMLTest.zip?raw=true).

## Additional Resources
* [RadASM IDE](http://www.softpedia.com/get/Programming/File-Editors/RadASM.shtml)
* [Masm32](http://www.masm32.com/download.htm)
* [UASM](http://www.terraspace.co.uk/uasm.html)
If you like this project and would like to support me, consider buying me a coffee: [buymeacoffee.com/mrfearless](https://www.buymeacoffee.com/mrfearless)