Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 20.1 ('Debugging')
Instant purchase and download via GumRoad!

COLUMN

I See Through You

Working With Transparent PDFs

Issue: 20.1 (January/February 2022)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 8,587
Starting Page Number: 52
Article Number: 20106
Resource File(s):

Download Icon project20106.zip Updated: 2022-01-02 19:45:08

Related Link(s): None

Excerpt of article text...

For a Christmas project I wanted to find an appropriate font. I started browsing through my thousands of fonts and discovered that's a challenging problem. Unless you actually install a font, MacOS doesn't give you much of a preview.

I thought: "I should use Xojo to make an app that would create a PDF of samples of all my fonts." As usual when I think of a personal project, I figured I'd write about it in xDev and get an article out of it, too!

Sadly, I could not get the PDFDocument.addFonts command to work for me. Even the code on Xojo's blog (https://blog.xojo.com/2020/08/27/xojos-pdfdocument-class-beyond-the-standard-14-and-more/) didn't work. If I installed the fonts, it worked, but the whole point of addFonts is it is supposed to work without installation and there was no way I wanted to install 2,000+ fonts just to pick one for my project!

So... today's column is going a different direction. I thought I'd explore PDFDocument's new ability to support transparency. This was added in 2021r3 and fills an important hole in Xojo's PDF support.

One of the keys of Xojo's PDF implementation is that it uses a clone of the graphics class, so any drawing you're already doing can easily be adapted to draw into a PDF instead. However, in the past, a significant limitation of this was that since PDFs didn't support transparency, what you got on the PDF often didn't match the screen.

Hopefully, that is now rectified, though I suspect that there are still going to be enough differences that you can't just assume stuff will match and you'll still need to do extensive testing.

...End of Excerpt. Please purchase the magazine to read the full article.