This is a test page in support of my Adobe Acrobat Pro bug report. Printing this page as a PDF from Firefox 158 on macOS or Linux, and then running the PDF Optimizer, will result in text shifting for the Roboto and Open Sans fonts.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PDF Font Optimization Test</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Open+Sans:wght@400;700&family=Poppins:wght@400;700&family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<style>
@page {
size: letter;
margin: 0.5in;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
color: #222;
font-family: Arial, sans-serif;
font-size: 10pt;
}
h1 {
margin: 0 0 5px;
font-size: 20pt;
line-height: 1.2;
}
.intro {
margin: 0 0 14px;
color: #555;
font-size: 9pt;
}
.font-box {
border: 1px solid #555;
margin: 0 0 12px;
padding: 10px 12px;
break-inside: avoid;
background: #fff;
}
.font-name {
font: bold 9pt Arial, sans-serif;
text-transform: uppercase;
letter-spacing: 0.5px;
border-bottom: 1px solid #ccc;
padding-bottom: 5px;
margin-bottom: 8px;
}
.sample h1,
.sample h2,
.sample h3,
.sample p {
margin: 0 0 6px;
}
.sample h1 { font-size: 18pt; line-height: 1.2; }
.sample h2 { font-size: 15pt; line-height: 1.25; }
.sample h3 { font-size: 12pt; line-height: 1.3; }
.sample p { font-size: 10pt; line-height: 1.45; }
.mixed {
margin: 0 0 6px;
font-size: 10pt;
line-height: 1.45;
}
.sample a {
color: #0645ad;
text-decoration: underline;
}
.roboto { font-family: "Roboto", sans-serif; }
.arial { font-family: Arial, sans-serif; }
.open-sans { font-family: "Open Sans", sans-serif; }
.poppins { font-family: "Poppins", sans-serif; }
.lato { font-family: "Lato", sans-serif; }
.metadata {
margin-top: 16px;
padding-top: 8px;
border-top: 1px solid #777;
font: 8pt/1.4 Arial, sans-serif;
color: #444;
overflow-wrap: anywhere;
}
.metadata strong {
color: #222;
}
@media screen {
body {
max-width: 850px;
margin: 24px auto;
padding: 24px;
background: #eee;
}
.font-box {
box-shadow: 0 1px 2px #ccc;
}
}
</style>
</head>
<body>
<h1>PDF Font Optimization Test</h1>
<p class="intro">
Print this page to PDF, then optimize it in Acrobat. Compare the original
and optimized PDFs for text shifting, overlap, font embedding, and links.
</p>
<div id="font-tests"></div>
<div class="metadata">
<strong>PDF test environment</strong><br>
<span id="environment">Detecting browser and operating system…</span><br>
<span id="timestamp"></span>
</div>
<script>
const fontTests = [
{ name: "Roboto", className: "roboto" },
{ name: "Arial", className: "arial" },
{ name: "Open Sans", className: "open-sans" }
];
const sampleHTML = `
<h1>Heading One — Sample Text</h1>
<h2>Heading Two — Sample Text</h2>
<h3>Heading Three — Sample Text</h3>
<p>
This is a generic sample paragraph designed to test text positioning,
line spacing, and character spacing after PDF optimization. The quick
brown fox jumps over the lazy dog.
</p>
<p class="mixed">
This sentence mixes regular text with <strong>bold text in the same
sentence</strong> to help identify whether different font subsets
shift independently or overlap.
</p>
<p class="mixed">
This sentence includes <em>italic text for comparison</em> and
finishes with regular text.
</p>
<p class="mixed">
Hyperlink test: <a href="https://example.com/">visit this sample link</a>
to verify that links remain clickable after optimization.
</p>
`;
const container = document.getElementById("font-tests");
fontTests.forEach(font => {
const section = document.createElement("section");
section.className = "font-box";
const label = document.createElement("div");
label.className = "font-name";
label.textContent = font.name;
const sample = document.createElement("div");
sample.className = "sample " + font.className;
sample.innerHTML = sampleHTML;
section.appendChild(label);
section.appendChild(sample);
container.appendChild(section);
});
function detectOS() {
const ua = navigator.userAgent || "";
const platform = navigator.userAgentData?.platform || navigator.platform || "";
if (/Windows/i.test(ua) || /Win/i.test(platform)) return "Windows";
if (/Macintosh|Mac OS X/i.test(ua) || /Mac/i.test(platform)) return "macOS";
if (/Android/i.test(ua)) return "Android";
if (/iPhone|iPad|iPod/i.test(ua) || /iPhone|iPad|iPod/i.test(platform)) return "iOS/iPadOS";
if (/Linux/i.test(ua) || /Linux/i.test(platform)) return "Linux";
return "Unknown OS (browser-restricted information)";
}
function detectBrowser() {
const ua = navigator.userAgent || "";
if (/Edg\//i.test(ua)) return "Microsoft Edge";
if (/OPR\//i.test(ua) || /Opera/i.test(ua)) return "Opera";
if (/Firefox\//i.test(ua)) return "Mozilla Firefox";
if (/Chrome\//i.test(ua) && !/Edg\//i.test(ua)) return "Google Chrome / Chromium";
if (/Safari\//i.test(ua) && !/Chrome\//i.test(ua)) return "Safari";
return "Unknown browser";
}
document.getElementById("environment").textContent =
"Operating system: " + detectOS() +
" | Browser: " + detectBrowser() +
" | User agent: " + navigator.userAgent;
document.getElementById("timestamp").textContent =
"Test page generated: " + new Date().toLocaleString();
</script>
</body>
</html>