Athletics Certificate Generator: Customnizing fonts, colors and positions of text
appdev ai powershell graphics certs
Fully customizable version of the package so that yje text metadata can be easily adjusted to suit a different background image and event title etc. GitHub
Nb: These changes in the repository are yet to be published on. Watch this space.
About
Have just completed adjusting the scripts etc so that the package is more reusable for another event. In particular Doncaster Masters Athletics held a similar event to the one we held at Aberfeldie Masters. Theirs was a 1 hour track run with 3 minute and walk options. Focus here was upon changing the background singlet image as well as adjusting the overlaying text for headings, labels and data font size, color and vertical locations.
Results
Results are from results.csv now.
They can be comma separated or tab separated.
Filename as defined in CertificateText.ps1 is unchanged whichever is used.
Note: Have to manually change the email subject in `generate scripts to match the event name.
Links
- GitHub Repository djaus2/AthleticsCertificateMaker
- Sample certificate 004-Fred Nurk.png
- Overview blog post
- Image template generation blog post
- Image Template Generation Appendix
- Sending Certificates and Results
- General Use Version
Doncaster Text Size, Color and Locations
This document records the changes made to certificate typography, colors, positions (Y coordinates), and layout configurations in DoncasterCertificateText.ps1for the Doncaster event certificates generation.
Nb: There is now a specification of the
CertificateTextscript filename at the top of theGeneratescripts.
1. Global / Default Color & Size Settings
| Setting | Previous Value | Doncaster Value | Description |
|---|---|---|---|
$CertificateTemplateFile |
"CertificateTemplate.png" |
"DoncasterCertificateTemplate2.png" |
Template background image |
$ParticipantCsvFile |
"results.xlsx" (as spreadsheet) |
"results.csv" |
Data source moved from Excel to CSV |
$SendUsingAccount |
"account@location.com.au" |
"account@location.com.au" |
Outlook sender account |
$DefaultTextColor |
@(0, 20, 90) (RGB) |
"Red" |
Base default text color |
$DefaultLabelColor |
None (used shared RGB) | "LightGreen" |
Default color for participant field labels |
$DefaultValueColor |
None (used shared RGB) | "Yellow" |
Default color for participant field values |
$DefaultLabelTextSize |
48 (via $LabelValueSize) |
70 |
Default font size (px) for field labels |
$DefaultDataTextSize |
48 (via $LabelValueSize) |
90 |
Default font size (px) for participant data values |
2. Header Text ($CertificateText)
All header items are centred horizontally at their specified vertical Y coordinate (in pixels from the top of the canvas).
| Field Name | Text | Font | Size (px) | Style | Color | Y Position | Notes / Changes |
|---|---|---|---|---|---|---|---|
| Title | 1 HOUR TRACK RUN |
Times New Roman | 90 | Bold | $DefaultTextColor ("Red") |
70 |
Size increased from 77 to 90 px; explicit color added |
| SubTitle | Doncaster Athletics Centre |
Arial Narrow | 38 | Regular | "White" |
340 |
Text changed from “Moonee Valley Athletics Centre”; size adjusted from 51 to 38 px; Y moved from 180 to 340; color set to "White" |
| Host | "" |
Times New Roman | 38 | Italic | $DefaultTextColor ("Red") |
360 |
Text cleared (previously “Aberfeldie Masters Athletics”); Y moved from 247 to 360 |
| Date | 5th October 2026 |
Arial Narrow | 51 | Regular | "LightGreen" |
410 |
Date changed from “16 September 2026”; size adjusted from 34 to 51 px; Y moved from 312 to 410; color set to "LightGreen" |
3. Participant Field Definitions ($CertificateFields)
Participant fields render a label above the participant’s data value.
3.1 Standard Fields ($CertificateFields.Standard)
Used by GenerateCertificates.ps1.
| Field | Element | Text / Value Source | Font | Size (px) | Style | Color | Y Position |
|---|---|---|---|---|---|---|---|
| Name | Label | "Name:" |
Arial | 70 ($DefaultLabelTextSize) |
Bold | $DefaultLabelColor ("LightGreen") |
800 (was 1050) |
| Value | $Participant.Name |
Arial | 90 ($DefaultDataTextSize) |
Regular | $DefaultValueColor ("Yellow") |
900 (was 1150) |
|
| Distance | Label | "Distance" |
Arial | 70 ($DefaultLabelTextSize) |
Bold | $DefaultLabelColor ("LightGreen") |
1100 (was 1265) |
| Value | "$($Participant.Distance) metres" |
Arial | 90 ($DefaultDataTextSize) |
Regular | $DefaultValueColor ("Yellow") |
1200 (was 1380) |
3.2 Time Fields ($CertificateFields.Time)
Used by GenerateCertificatesTIME.ps1.
| Field | Element | Text / Value Source | Font | Size (px) | Style | Color | Y Position |
|---|---|---|---|---|---|---|---|
| Name | Label | "Name" |
Arial | 70 ($DefaultLabelTextSize) |
Bold | $DefaultLabelColor ("LightGreen") |
800 (was 1030) |
| Value | $Participant.Name |
Arial | 90 ($DefaultDataTextSize) |
Regular | $DefaultValueColor ("Yellow") |
900 (was 1110) |
|
| Distance | Label | "Distance" |
Arial | 70 ($DefaultLabelTextSize) |
Bold | $DefaultLabelColor ("LightGreen") |
1050 (was 1190) |
| Value | "$($Participant.Distance) metres" |
Arial | 90 ($DefaultDataTextSize) |
Regular | $DefaultValueColor ("Yellow") |
1150 (was 1270) |
|
| Time | Label | "Time" |
Arial | 70 ($DefaultLabelTextSize) |
Bold | $DefaultLabelColor ("LightGreen") |
1300 (was 1350) |
| Value | $Participant.Time |
Arial | 90 ($DefaultDataTextSize) |
Regular | $DefaultValueColor ("Yellow") |
1400 (was 1430) |
4. Script & Workflow Updates Summary
- Excel Removal:
- Replaced dependency on
ImportExcel/Excel.Applicationwith nativeImport-Csvfrom results.csv. - Generated results PDF using headless Microsoft Edge via
Export-ResultsPdf.ps1.
- Replaced dependency on
- Color Customization:
- Added support for named drawing colors via
[System.Drawing.Color]::FromName(...). - Introduced
$DefaultTextColor,$DefaultLabelColor, and$DefaultValueColor. - Enabled per-element
Coloroverrides on header items, labels, and participant values.
- Added support for named drawing colors via
- Size Configuration:
- Replaced fixed
$LabelValueSizeand delta calculation with explicit$DefaultLabelTextSizeand$DefaultDataTextSize.
- Replaced fixed
- Script Parametrization:
- Added
$CertificateTextDefinitionFile = "CertificateText.ps1"definition at the top of GenerateCertificates.ps1.
- Added
| Topic | Subtopic | |
| Next: > | Athletics Certificate Generator | A report on some tweaks to further generalize the scripts |
| < Prev: | Athletics Certificate Generator | How To |
| This Category Links | ||
| Category: | Application Dev Index: | Application Dev |