Raise the ordinal suffix on the bonafide certificate - #1980
Merged
vikrantwiz02 merged 1 commit intoSep 2, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
4thto 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:
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,11thall split correctly, and empty orNonereturns an empty string.manage.py checkclean, no migration.