Hussien Haider commited on
Commit
6c9922c
Β·
1 Parent(s): 05a9e8e
Files changed (1) hide show
  1. app/services/certificate_service.py +17 -18
app/services/certificate_service.py CHANGED
@@ -159,9 +159,9 @@ def _draw_shield(c: "canvas.Canvas", cx: float, cy: float, sz: float):
159
  p.curveTo(ox(45.33), oy(209.33), ox(18), oy(174.67), ox(18), oy(128))
160
  p.lineTo(ox(18), oy(48))
161
  p.closePath()
162
- p.STROKE_COLOR = G
163
- p.STROKE_WIDTH = max(0.5, S * 3)
164
- p.FILL_COLOR = L
165
  g.add(p)
166
 
167
  # Inner dashed shield
@@ -175,16 +175,16 @@ def _draw_shield(c: "canvas.Canvas", cx: float, cy: float, sz: float):
175
  p2.curveTo(ox(54.67), oy(201.33), ox(32), oy(181.33), ox(32), oy(128))
176
  p2.lineTo(ox(32), oy(56))
177
  p2.closePath()
178
- p2.STROKE_COLOR = Color(16/255, 185/255, 129/255, alpha=0.25)
179
- p2.STROKE_WIDTH = max(0.3, S * 1)
180
- p2.STROKE_DASHARRAY = [max(1, S * 3), max(1, S * 4)]
181
- p2.FILL_COLOR = None
182
  g.add(p2)
183
 
184
  # Lock body
185
  lock = Rect(-S*56/2, oy(154), S*56, S*48, rx=S*6, ry=S*6)
186
- lock.FILL_COLOR = G
187
- lock.STROKE_COLOR = None
188
  g.add(lock)
189
 
190
  # Lock shackle (U-shape via two lines + arc)
@@ -198,22 +198,22 @@ def _draw_shield(c: "canvas.Canvas", cx: float, cy: float, sz: float):
198
  k = 0.552 * r18
199
  shackle.curveTo(ox(82), oy(102) + k, ox(118), oy(102) + k, ox(118), oy(102))
200
  shackle.lineTo(ox(118), oy(118))
201
- shackle.STROKE_COLOR = G
202
- shackle.STROKE_WIDTH = sw
203
  # "round" line cap
204
- shackle.FILL_COLOR = None
205
  g.add(shackle)
206
 
207
  # Keyhole circle
208
  kh = Circle(ox(100), oy(138), S*5)
209
- kh.FILL_COLOR = D
210
- kh.STROKE_COLOR = None
211
  g.add(kh)
212
 
213
  # Keyhole rectangle below
214
  khr = Rect(ox(100)-S*2.5, oy(144)-S*7, S*5, S*14, rx=S*1, ry=S*1)
215
- khr.FILL_COLOR = D
216
- khr.STROKE_COLOR = None
217
  g.add(khr)
218
 
219
  d.add(g)
@@ -293,7 +293,7 @@ def build_certificate_pdf(
293
  lang: str = "en",
294
  ) -> bytes:
295
  from reportlab.lib.pagesizes import landscape, A4
296
- from reportlab.lib.colors import HexColor
297
  from reportlab.lib.units import mm
298
  from reportlab.pdfgen import canvas
299
  import qrcode
@@ -306,7 +306,6 @@ def build_certificate_pdf(
306
  # ── Landing Page color palette (cream/white, emerald, amber) ──
307
  BG_CARD = HexColor("#FFFFFF") # white card
308
  GREEN = HexColor("#10B981") # emerald β€” primary brand accent
309
- GREEN_SOFT = Color(16/255, 185/255, 129/255, alpha=0.08)
310
  AMBER = HexColor("#F59E0B") # amber/gold accent
311
  TEXT_PRI = HexColor("#0A0A0A") # near black
312
  TEXT_SEC = HexColor("#5A5A58") # medium gray
 
159
  p.curveTo(ox(45.33), oy(209.33), ox(18), oy(174.67), ox(18), oy(128))
160
  p.lineTo(ox(18), oy(48))
161
  p.closePath()
162
+ p.strokeColor = G
163
+ p.strokeWidth = max(0.5, S * 3)
164
+ p.fillColor = L
165
  g.add(p)
166
 
167
  # Inner dashed shield
 
175
  p2.curveTo(ox(54.67), oy(201.33), ox(32), oy(181.33), ox(32), oy(128))
176
  p2.lineTo(ox(32), oy(56))
177
  p2.closePath()
178
+ p2.strokeColor = Color(16/255, 185/255, 129/255, alpha=0.25)
179
+ p2.strokeWidth = max(0.3, S * 1)
180
+ p2.strokeDashArray = [max(1, S * 3), max(1, S * 4)]
181
+ p2.fillColor = None
182
  g.add(p2)
183
 
184
  # Lock body
185
  lock = Rect(-S*56/2, oy(154), S*56, S*48, rx=S*6, ry=S*6)
186
+ lock.fillColor = G
187
+ lock.strokeColor = None
188
  g.add(lock)
189
 
190
  # Lock shackle (U-shape via two lines + arc)
 
198
  k = 0.552 * r18
199
  shackle.curveTo(ox(82), oy(102) + k, ox(118), oy(102) + k, ox(118), oy(102))
200
  shackle.lineTo(ox(118), oy(118))
201
+ shackle.strokeColor = G
202
+ shackle.strokeWidth = sw
203
  # "round" line cap
204
+ shackle.fillColor = None
205
  g.add(shackle)
206
 
207
  # Keyhole circle
208
  kh = Circle(ox(100), oy(138), S*5)
209
+ kh.fillColor = D
210
+ kh.strokeColor = None
211
  g.add(kh)
212
 
213
  # Keyhole rectangle below
214
  khr = Rect(ox(100)-S*2.5, oy(144)-S*7, S*5, S*14, rx=S*1, ry=S*1)
215
+ khr.fillColor = D
216
+ khr.strokeColor = None
217
  g.add(khr)
218
 
219
  d.add(g)
 
293
  lang: str = "en",
294
  ) -> bytes:
295
  from reportlab.lib.pagesizes import landscape, A4
296
+ from reportlab.lib.colors import HexColor, Color
297
  from reportlab.lib.units import mm
298
  from reportlab.pdfgen import canvas
299
  import qrcode
 
306
  # ── Landing Page color palette (cream/white, emerald, amber) ──
307
  BG_CARD = HexColor("#FFFFFF") # white card
308
  GREEN = HexColor("#10B981") # emerald β€” primary brand accent
 
309
  AMBER = HexColor("#F59E0B") # amber/gold accent
310
  TEXT_PRI = HexColor("#0A0A0A") # near black
311
  TEXT_SEC = HexColor("#5A5A58") # medium gray