From 7a89f4a78979c2f3532d483877c0e996884660ff Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 9 Jun 2022 09:52:28 +0200 Subject: [PATCH 1/3] Set the MIME type correctly when downloading fonts in `debugger.js` (PR 5366 follow-up) Because of a capitalization error, the MIME type wasn't actually being set correctly. However, please note that downloading of font files still worked correctly which is probably why this has gone unnoticed since 2014. --- web/debugger.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/debugger.js b/web/debugger.js index 1d5571007..5bc6bdf95 100644 --- a/web/debugger.js +++ b/web/debugger.js @@ -117,7 +117,7 @@ const FontInspector = (function FontInspectorClosure() { download.href = url[1]; } else if (fontObj.data) { download.href = URL.createObjectURL( - new Blob([fontObj.data], { type: fontObj.mimeType }) + new Blob([fontObj.data], { type: fontObj.mimetype }) ); } download.textContent = "Download"; From b5cad9be03a11f58731bf946c6fe2d0c6b649963 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 9 Jun 2022 10:03:36 +0200 Subject: [PATCH 2/3] Fix a bug in the `ColorConverters.CMYK_HTML` method (PR 12631 follow-up) Because of a small oversight, this method accidentally handled the intermediate array incorrectly. --- src/shared/scripting_utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/scripting_utils.js b/src/shared/scripting_utils.js index 48e04d775..643922051 100644 --- a/src/shared/scripting_utils.js +++ b/src/shared/scripting_utils.js @@ -70,7 +70,8 @@ class ColorConverters { } static CMYK_HTML(components) { - return this.RGB_HTML(this.CMYK_RGB(components)); + const rgb = this.CMYK_RGB(components).slice(1); + return this.RGB_HTML(rgb); } static RGB_CMYK([r, g, b]) { From 66bbc0e7ee03c0584dfa111ba08360b365d1ee66 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 9 Jun 2022 10:11:01 +0200 Subject: [PATCH 3/3] Call `WidgetAnnotation._getTextWidth` correctly from the `ChoiceWidgetAnnotation`-class (PR 14720 follow-up) In the "no fontSize available" code-path, in the `ChoiceWidgetAnnotation._getAppearance` method, we don't provide the necessary second argument when calling the `_getTextWidth`-method which will cause errors to be thrown. --- src/core/annotation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/annotation.js b/src/core/annotation.js index 542fdc5c5..615b049c0 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -2706,7 +2706,7 @@ class ChoiceWidgetAnnotation extends WidgetAnnotation { let lineWidth = -1; let value; for (const { displayValue } of this.data.options) { - const width = this._getTextWidth(displayValue); + const width = this._getTextWidth(displayValue, font); if (width > lineWidth) { lineWidth = width; value = displayValue;