Results 1 to 3 of 3

Thread: [twinBASIC] ColorFontLabel - Color emojis, angled text, and more (w/ OCX for VB6/VBA)

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    Cool [twinBASIC] ColorFontLabel - Color emojis, angled text, and more (w/ OCX for VB6/VBA)

    ColorFontLabel v1.3

    Name:  image-2.png
Views: 1106
Size:  69.9 KB

    ColorFontLabel is a UserControl/ActiveX Label Control that supports Color Fonts-- fonts that have characters with multiple colors, most commonly used for color emojis that are still copy/paste-able text and not images. Powered with Direct2D/DirectWrite.

    Additional features
    • Font effects (bold, italic, underline, strikethru, condense/expand) can be applied only to a specific range.
    • Angled text
    • Color gradients (linear and radial)
    • Locale can be specified
    • Several options for word wrap mode
    • Set line spacing
    • Antialiasing options
    • Can act as a drop target for DragDrop from other apps and displays the fancy icons like Explorer.
    • Mouse events including MouseWheel
    • Background picture property with stretch or offset options
    • Normal Label properties like Alignment, RightToLeft, ForeColor/BackColor, etc.


    The project is provided as both a UserControl you can use within twinBASIC projects, and as a OCX control tested to work in VB6 and VBA (both 32 and 64bit). ColorFontLabel.twinproj can be used to build the OCX, and ucColorFontLabel.tbcontrol/.twin are the files you'd import to use in a project, with ucColorFontTest.twinproj being a test project for this type.

    Requirements
    -Color fonts are only supported on Windows 8 and above. The control should work on Windows 7, but emojis etc would be in black and white.
    -For building or IDE use of the tbcontrol version, my WinDevLib package, v9.1.566+, is required (References->Available packages). Projects use the new package linking option so it's no longer embedded by default, which means I can once again post it here!
    -The latest twinBASIC Beta is recommended, and 828+ is required, to build the OCX or read the test project.

    Changelog

    • v1.3 (07 Jul 2025)
      - Bug fix: Font was smaller than regular label with same font/size.
      - Bug fix: PictureStretch size wrong when DPI awareness enabled.
    • v1.2 (07 Jul 2025)

      - Added support for Picture property to set a background image. PictureStretch property sets whether it's stretched to fill the label. If not, you can set an x/y offset with PictureOffsetX/Y.

      Name:  463062808-7bd57627-c4f2-49c1-9184-defa09eddb8b.png
Views: 665
Size:  5.1 KB
    • v1.1 (05 Jul 2025)
      - Now using quicker/more stable DC render target. Thanks to Wayne Phillips for this contribution. This works better in the IDE and faster at runtime.
      (Bug fix) Size/position badly broken when DPI awareness enabled.


    Name:  462718143-c3ad5dad-8afa-475e-9cd3-e54642a34d6e.png
Views: 670
Size:  44.7 KB Name:  462718590-2aebfb7f-7b36-4fc3-a7b4-c9c458c545f4.png
Views: 655
Size:  38.4 KB

    Project repository (may be more up to date)
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width