Urgent.News

What's breaking now, across thousands of outlets.

Tech

Headless Java servers and the fonts nobody installed

If your Java service draws text anywhere (a chart in a PDF report, a label on a generated thumbnail, a watermark on an uploaded image), it depends on whatever fonts are installed on the machine it runs on. Most developers never think of fonts as a dependency. Their laptop has a few hundred of them. The production container has a handful, or none, and nobody wrote that down. I’ve spent a lot of…

Java applications that generate text-based output often encounter issues due to font dependencies. Most developers overlook fonts as a requirement, assuming their local machine has the necessary files. However, production containers typically lack fonts, leading to unexpected problems. Headless Java servers, which don't have a graphical display, still require font handling for tasks like generating images or documents.

Font-related bugs can cause subtle output discrepancies that only appear on specific machines. To address these issues, developers can explicitly install font packages in their base images, such as fontconfig and dejavu-core. It's crucial to check which fonts are available on the production image and ensure that code requests specific font families.

Bundling the required font with the application can help ensure consistent output across different environments. Additionally, checking the available font families and handling cases where requested fonts are missing can prevent rendering issues. Before deploying, developers should verify which fonts are included in the production image, ensure the build process installs fonts intentionally, and test rendering in the same environment as production.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Maker.sh

A New Build and Automation Protocol for the AI Era: maker.sh , MakerChain, and the MakerCompiler Architecture With the rapid acceleration of AI-assisted software development, one of the fundamental…

  • Maker.sh streamlines AI-assisted software development with build and automation protocol.
  • MakerChain architectural framework combines shell scripting and modern package manager disciplines.
  • MakerCompiler's four layers ensure secure system actions and provide execution summary.

What a 499 CNY sensing node costs to build, and where we refused to save

A short, deliberately unglamorous post about cost, because the price of a consumer sensing product is an engineering decision and pretending otherwise produces bad devices.

  • 499 CNY cost includes radio module, MCU, and enclosure as major components
  • Company retained antenna quality, burn-in testing, and status indicators
  • Monthly 30 CNY service fee covers cloud services and support

More from Friday 13 November →