Skip to content

Raise the ordinal suffix on the bonafide certificate - #1980

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:acad-certificate-ordinal-superscript
Sep 2, 2026
Merged

Raise the ordinal suffix on the bonafide certificate#1980
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:acad-certificate-ordinal-superscript

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

The certificate read 4th Year (7th Semester) with the suffix on the baseline, where the convention on a printed certificate is to set it as a superscript.

superscript_ordinal() splits an ordinal into its digits and suffix and wraps the suffix in reportlab's <super> tag. Anything that is not a plain ordinal falls through to the previous escaped output, so an empty or unexpected value cannot inject markup — the suffix itself is escaped as well.

The value stored on the context is unchanged, so the API still returns 4th to any other caller; only the PDF rendering is marked up.

Verified in the generated PDF's content stream, which is where a superscript is actually visible — text extraction flattens it:

(4) Tj  /F2 11.5 Tf  6.75 Ts  (th)

The digit prints at the body size, the suffix smaller and raised 6.75pt above the baseline; the same happens for the semester. No markup leaks into the text, and the certificate still fits one page.

Helper output across the cases: 1st, 2nd, 3rd, 4th, 11th all split correctly, and empty or None returns an empty string.

manage.py check clean, no migration.

The year and semester read as plain 4th and 7th, where the convention on
a printed certificate is to set the suffix as a superscript. The suffix
is now raised, so the line reads 4th Year with the th above the
baseline, matching how the same wording is typed by hand.

The ordinal is still stored plainly on the context, so the API keeps
returning 4th to any other caller; only the rendering is marked up.
@vikrantwiz02
vikrantwiz02 merged commit 4c8ce28 into FusionIIIT:prod/acad-react Sep 2, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant