Commit 03987b82 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

set the default fonts to the PDF base fonts (Helvetica, Times, Courier)

parent d7189fc0
Loading
Loading
Loading
Loading
+23 −13
Original line number Diff line number Diff line
@@ -75,20 +75,26 @@ ReturnCode font_load(DefaultFont font_name, FontInfo* font_info) {
      break;

    case ROMAN_SERIF_REGULAR:
      font_fc = "CMU Serif,serif:style=Regular,Roman";
      font_info->font_family_css = "'CMU Serif', serif";
      font_fc = "Times New Romain,serif:style=Regular,Roman";
      font_info->font_family_css = "'Times New Roman', serif";
      font_info->font_weight_css = 400;
      break;

    case ROMAN_SERIF_MEDIUM:
      font_fc = "CMU Serif,serif:style=Regular,Roman";
      font_info->font_family_css = "'CMU Serif', serif";
      font_info->font_weight_css = 500;
    case ROMAN_SERIF_BOLD:
      font_fc = "Times New Roman,serif:style=Bold,Roman";
      font_info->font_family_css = "'Times New Roman', serif";
      font_info->font_weight_css = 600;
      break;

    case ROMAN_SERIF_BOLD:
      font_fc = "CMU Serif,serif:style=Regular,Roman";
      font_info->font_family_css = "'CMU Serif', serif";
    case ROMAN_MONOSPACE_REGULAR:
      font_fc = "Courier,serif:style=Regular,Roman";
      font_info->font_family_css = "'Courier', monospace";
      font_info->font_weight_css = 400;
      break;

    case ROMAN_MONOSPACE_BOLD:
      font_fc = "Courier,serif:style=Bold,Roman";
      font_info->font_family_css = "'Courier', monospace";
      font_info->font_weight_css = 600;
      break;
  }
@@ -118,13 +124,17 @@ ReturnCode font_configure(const Expr* expr, FontInfo* font_info) {
      expr_is_value(expr, "roman-serif-regular")) {
    return font_load(ROMAN_SERIF_REGULAR, font_info);
  }
  if (expr_is_value(expr, "roman-serif-bold")) {
    return font_load(ROMAN_SERIF_BOLD, font_info);
  }

  if (expr_is_value(expr, "roman-serif-medium")) {
    return font_load(ROMAN_SERIF_MEDIUM, font_info);
  if (expr_is_value(expr, "roman-monospace") ||
      expr_is_value(expr, "roman-monospace-regular")) {
    return font_load(ROMAN_MONOSPACE_REGULAR, font_info);
  }

  if (expr_is_value(expr, "roman-serif-bold")) {
    return font_load(ROMAN_SERIF_BOLD, font_info);
  if (expr_is_value(expr, "roman-monospace-bold")) {
    return font_load(ROMAN_MONOSPACE_BOLD, font_info);
  }

  std::vector<std::string> font_names;
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@ enum DefaultFont {
  ROMAN_SERIF_REGULAR,
  ROMAN_SERIF_MEDIUM,
  ROMAN_SERIF_BOLD,
  ROMAN_MONOSPACE_REGULAR,
  ROMAN_MONOSPACE_MEDIUM,
  ROMAN_MONOSPACE_BOLD,
};

ReturnCode font_load(DefaultFont font_name, FontInfo* font_info);
+46 −46
Original line number Diff line number Diff line
@@ -24,50 +24,50 @@
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M93.4295 60.6711 L880.444 60.6711 "/>
  <path stroke-width="1.000000" stroke="#ffffff" fill="none" d="M93.4295 19.5556 L880.444 19.5556 "/>
  <path fill="#888888" d="M93.4295 19.5556 L102.799 107.114 L113.778 161.035 L124.758 156.724 L135.737 200.264 L146.717 227.698 L157.697 245.987 L168.676 257.192 L179.656 285.875 L190.635 234.991 L201.615 251.011 L212.594 300.12 L223.574 237.397 L234.553 245.056 L245.533 293.513 L256.513 286.976 L267.492 319.292 L278.472 341.413 L289.451 375.191 L300.431 387.727 L311.41 405.183 L322.39 269.319 L333.37 168.056 L344.349 140.639 L355.329 164.866 L366.308 220.868 L377.288 298.518 L388.267 292.334 L399.247 339.212 L410.226 355.058 L421.206 377.338 L432.186 357.141 L443.165 381.779 L454.145 334.569 L465.124 295.945 L476.104 376.258 L487.083 386.472 L498.063 399.341 L509.042 430.711 L520.022 365.67 L531.002 336.998 L541.981 339.993 L552.961 355.88 L563.94 313.253 L574.92 380.068 L585.899 334.709 L596.879 316.28 L607.859 318.302 L618.838 342.629 L629.818 292.465 L640.797 284.172 L651.777 251.736 L662.756 292.431 L673.736 333.299 L684.715 365.732 L695.695 303.249 L706.675 332.675 L717.654 326.385 L728.634 382.33 L739.613 398.451 L750.593 381.339 L761.572 394.327 L772.552 380.969 L783.532 358.762 L794.511 366.009 L805.491 351.244 L816.47 328.971 L827.45 341.325 L838.429 361.442 L849.409 288.295 L860.388 278.505 L871.368 238.808 L880.444 242.922 L880.444 430.711 L871.368 430.711 L860.388 430.711 L849.409 430.711 L838.429 430.711 L827.45 430.711 L816.47 430.711 L805.491 430.711 L794.511 430.711 L783.532 430.711 L772.552 430.711 L761.572 430.711 L750.593 430.711 L739.613 430.711 L728.634 430.711 L717.654 430.711 L706.675 430.711 L695.695 430.711 L684.715 430.711 L673.736 430.711 L662.756 430.711 L651.777 430.711 L640.797 430.711 L629.818 430.711 L618.838 430.711 L607.859 430.711 L596.879 430.711 L585.899 430.711 L574.92 430.711 L563.94 430.711 L552.961 430.711 L541.981 430.711 L531.002 430.711 L520.022 430.711 L509.042 430.711 L498.063 430.711 L487.083 430.711 L476.104 430.711 L465.124 430.711 L454.145 430.711 L443.165 430.711 L432.186 430.711 L421.206 430.711 L410.226 430.711 L399.247 430.711 L388.267 430.711 L377.288 430.711 L366.308 430.711 L355.329 430.711 L344.349 430.711 L333.37 430.711 L322.39 430.711 L311.41 430.711 L300.431 430.711 L289.451 430.711 L278.472 430.711 L267.492 430.711 L256.513 430.711 L245.533 430.711 L234.553 430.711 L223.574 430.711 L212.594 430.711 L201.615 430.711 L190.635 430.711 L179.656 430.711 L168.676 430.711 L157.697 430.711 L146.717 430.711 L135.737 430.711 L124.758 430.711 L113.778 430.711 L102.799 430.711 L93.4295 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 430.711 L880.444 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 425.378 L93.4295 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M172.131 425.378 L172.131 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M250.833 425.378 L250.833 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M329.534 425.378 L329.534 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M408.235 425.378 L408.235 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M486.937 425.378 L486.937 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M565.638 425.378 L565.638 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M644.34 425.378 L644.34 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M723.041 425.378 L723.041 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M801.743 425.378 L801.743 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M880.444 425.378 L880.444 430.711 "/>
  <text x="64.882639" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">05:15:44</text>
  <text x="143.584133" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">05:51:34</text>
  <text x="222.285627" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">06:27:24</text>
  <text x="300.987127" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">07:03:15</text>
  <text x="379.688616" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">07:39:05</text>
  <text x="458.390104" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">08:14:56</text>
  <text x="537.091616" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">08:50:46</text>
  <text x="615.793081" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">09:26:36</text>
  <text x="694.494593" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10:02:27</text>
  <text x="773.196105" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10:38:17</text>
  <text x="852.444444" y="456.444444" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">11:14:08</text>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 19.5556 L93.4295 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 430.711 L98.7628 430.711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 389.596 L98.7628 389.596 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 348.48 L98.7628 348.48 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 307.364 L98.7628 307.364 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 266.249 L98.7628 266.249 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 225.133 L98.7628 225.133 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 184.018 L98.7628 184.018 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 142.902 L98.7628 142.902 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 101.787 L98.7628 101.787 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 60.6711 L98.7628 60.6711 "/>
  <path stroke-width="0.000000" stroke="#333333" fill="none" d="M93.4295 19.5556 L98.7628 19.5556 "/>
  <text x="19.555556" y="435.711111" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.3 × 10⁶</text>
  <text x="19.555556" y="394.595555" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.4 × 10⁶</text>
  <text x="19.555556" y="353.479999" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.6 × 10⁶</text>
  <text x="19.555556" y="312.364440" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.7 × 10⁶</text>
  <text x="19.555556" y="271.248886" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.8 × 10⁶</text>
  <text x="19.555556" y="230.133333" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.0 × 10⁶</text>
  <text x="19.555556" y="189.017768" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.1 × 10⁶</text>
  <text x="19.555556" y="147.902227" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.2 × 10⁶</text>
  <text x="19.555556" y="106.786662" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.4 × 10⁶</text>
  <text x="19.555556" y="65.671096" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.5 × 10⁶</text>
  <text x="19.555556" y="24.555556" fill="#333333" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.6 × 10⁶</text>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 430.711 L880.444 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 425.378 L93.4295 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M172.131 425.378 L172.131 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M250.833 425.378 L250.833 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M329.534 425.378 L329.534 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M408.235 425.378 L408.235 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M486.937 425.378 L486.937 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M565.638 425.378 L565.638 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M644.34 425.378 L644.34 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M723.041 425.378 L723.041 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M801.743 425.378 L801.743 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M880.444 425.378 L880.444 430.711 "/>
  <text x="64.882639" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">05:15:44</text>
  <text x="143.584133" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">05:51:34</text>
  <text x="222.285627" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">06:27:24</text>
  <text x="300.987127" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">07:03:15</text>
  <text x="379.688616" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">07:39:05</text>
  <text x="458.390104" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">08:14:56</text>
  <text x="537.091616" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">08:50:46</text>
  <text x="615.793081" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">09:26:36</text>
  <text x="694.494593" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10:02:27</text>
  <text x="773.196105" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">10:38:17</text>
  <text x="852.444444" y="456.444444" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">11:14:08</text>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 19.5556 L93.4295 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 430.711 L98.7628 430.711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 389.596 L98.7628 389.596 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 348.48 L98.7628 348.48 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 307.364 L98.7628 307.364 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 266.249 L98.7628 266.249 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 225.133 L98.7628 225.133 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 184.018 L98.7628 184.018 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 142.902 L98.7628 142.902 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 101.787 L98.7628 101.787 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 60.6711 L98.7628 60.6711 "/>
  <path stroke-width="0.000000" stroke="#000000" fill="none" d="M93.4295 19.5556 L98.7628 19.5556 "/>
  <text x="19.555556" y="435.711111" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.3 × 10⁶</text>
  <text x="19.555556" y="394.595555" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.4 × 10⁶</text>
  <text x="19.555556" y="353.479999" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.6 × 10⁶</text>
  <text x="19.555556" y="312.364440" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.7 × 10⁶</text>
  <text x="19.555556" y="271.248886" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">7.8 × 10⁶</text>
  <text x="19.555556" y="230.133333" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.0 × 10⁶</text>
  <text x="19.555556" y="189.017768" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.1 × 10⁶</text>
  <text x="19.555556" y="147.902227" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.2 × 10⁶</text>
  <text x="19.555556" y="106.786662" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.4 × 10⁶</text>
  <text x="19.555556" y="65.671096" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.5 × 10⁶</text>
  <text x="19.555556" y="24.555556" fill="#000000" font-size="14.666667" font-family="Arial,Helvetica,'Helvetica Neue',sans-serif" font-weight="500.000000">8.6 × 10⁶</text>
</svg>
 No newline at end of file
+53 −53

File changed.

Preview size limit exceeded, changes collapsed.

+46 −46

File changed.

Preview size limit exceeded, changes collapsed.

Loading