Skip to content

Commit 7c925de

Browse files
authored
Feature: Authentic DIN 1451 font and EV Green color for Austria (#3)
* Add Austrian DIN font * Register font in CSS * Add font-austria class * Implement DIN font logic in Plate component * Set default color for Austria
1 parent 61bf7df commit 7c925de

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

public/fonts/AlteDIN1451.ttf

63.8 KB
Binary file not shown.

src/app/globals.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@
6363
font-style: normal;
6464
font-display: swap;
6565
}
66+
@font-face {
67+
font-family: 'Alte DIN 1451';
68+
src: url('/fonts/AlteDIN1451.ttf') format('truetype');
69+
font-weight: normal;
70+
font-style: normal;
71+
}
72+
73+
.font-austria {
74+
font-family: 'Alte DIN 1451', sans-serif;
75+
}
6676

6777
:root {
6878
--background: #f5f5f5;

src/components/LicensePlate.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ const LicensePlate = forwardRef<HTMLDivElement, LicensePlateProps>(
122122
if (typeof document !== 'undefined' && document.fonts) {
123123
const fontPromises = [
124124
document.fonts.load('105px EuroPlate'),
125+
document.fonts.load('105px "Alte DIN 1451"'),
125126
document.fonts.load('105px "Google Sans"'),
126127
document.fonts.load('105px Tratex'),
127128
document.fonts.load('105px UKNumberPlate'),
@@ -227,6 +228,7 @@ const LicensePlate = forwardRef<HTMLDivElement, LicensePlateProps>(
227228
if (country === 'S') return 'Tratex, Normal';
228229
if (country === 'N') return 'MyriadPro, sans-serif';
229230
if (country === 'GB') return 'UKNumberPlate, sans-serif';
231+
if (country === 'A') return '"Alte DIN 1451", sans-serif';
230232
return 'EuroPlate, sans-serif';
231233
};
232234

src/components/PlateGenerator.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,24 @@ export default function PlateGenerator() {
245245
if (!isInitialized) return;
246246
setConfig(prev => {
247247
const newConfig = { ...prev };
248+
249+
// --- ADDED: Austria Green Color Logic ---
250+
if (prev.country === 'A') {
251+
newConfig.fontColor = '#008351'; // Austrian EV Green
252+
} else if (prev.fontColor === '#008351') {
253+
254+
newConfig.fontColor = '#000000';
255+
}
256+
// ----------------------------------------
257+
248258
if (prev.country === 'S') {
249259
if (prev.plateType === 'normal') {
250-
// Set default normal format
251260
newConfig.plateText = 'ABC123';
252261
}
253262
} else {
254263
// Reset when not Sweden
255264
if (prev.plateText === 'ABC123') {
256-
newConfig.plateText = DEFAULT_CONFIG.plateText;
265+
newConfig.plateText = 'MUSTER';
257266
}
258267
}
259268
return newConfig;

0 commit comments

Comments
 (0)