abstract-image
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -90,3 +90,3 @@ "use strict"; | ||
fontSize: component.fontSize.toString() + "px", | ||
fontWeight: component.fontWeight === "mediumBold" ? "bold" : component.fontWeight, | ||
fontWeight: getTextFontWeight(component.fontWeight), | ||
fontFamily: component.fontFamily, | ||
@@ -99,3 +99,3 @@ stroke: colorToRgb(component.strokeColor), | ||
fontSize: component.fontSize.toString() + "px", | ||
fontWeight: component.fontWeight === "mediumBold" ? "bold" : component.fontWeight, | ||
fontWeight: getTextFontWeight(component.fontWeight), | ||
fontFamily: component.fontFamily, | ||
@@ -146,2 +146,13 @@ fill: colorToRgb(component.textColor), | ||
} | ||
function getTextFontWeight(fontWeight) { | ||
if (fontWeight === "mediumBold" || fontWeight === "extraBold") { | ||
return "bold"; | ||
} | ||
else if (fontWeight === "light") { | ||
return "normal"; | ||
} | ||
else { | ||
return fontWeight; | ||
} | ||
} | ||
function getImageUrl(format, data) { | ||
@@ -148,0 +159,0 @@ if (data.type === "url") { |
@@ -80,3 +80,3 @@ import * as Point from "./point"; | ||
export declare function corners(rectangle: Rectangle): Array<Point.Point>; | ||
export declare type AbstractFontWeight = "normal" | "mediumBold" | "bold"; | ||
export declare type AbstractFontWeight = "light" | "normal" | "mediumBold" | "bold" | "extraBold"; | ||
export declare type TextAlignment = "left" | "center" | "right"; | ||
@@ -83,0 +83,0 @@ export declare type GrowthDirection = "up" | "down" | "uniform" | "left" | "right"; |
{ | ||
"name": "abstract-image", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"description": "Dynamically create images using code or JSX and render to any format", | ||
@@ -29,3 +29,3 @@ "repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-image", | ||
}, | ||
"gitHead": "cc48e3f14a9ec319766ae3322bcdd98748718cab" | ||
"gitHead": "8d1489ac0f201c23159219b373ebc200a1390189" | ||
} |
@@ -207,3 +207,3 @@ import * as Point from "./point"; | ||
export type AbstractFontWeight = "normal" | "mediumBold" | "bold"; | ||
export type AbstractFontWeight = "light" | "normal" | "mediumBold" | "bold" | "extraBold"; | ||
@@ -210,0 +210,0 @@ export type TextAlignment = "left" | "center" | "right"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
646836
415
10713