emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/svg-lib 304a9e4fcd 2/3: Merge branch 'master' into patc


From: ELPA Syncer
Subject: [elpa] externals/svg-lib 304a9e4fcd 2/3: Merge branch 'master' into patch-2
Date: Thu, 3 Mar 2022 09:57:57 -0500 (EST)

branch: externals/svg-lib
commit 304a9e4fcd45fe1ce1ba63deeab5e9a7961aa1ab
Merge: 153d13c634 0486c94534
Author: Alberto <aru_hackz.official@zohomail.eu>
Commit: GitHub <noreply@github.com>

    Merge branch 'master' into patch-2
---
 svg-lib-demo.el |  2 +-
 svg-lib.el      | 27 ++++++++++++++++++---------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/svg-lib-demo.el b/svg-lib-demo.el
index eeeb6fa510..a5b0a1d4be 100644
--- a/svg-lib-demo.el
+++ b/svg-lib-demo.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2021 Free Software Foundation, Inc.
+;; Copyright (C) 2021 Free Software Foundation, Inc. -*- lexical-binding: t; 
-*-
 
 ;; This file is not part of GNU Emacs.
 
diff --git a/svg-lib.el b/svg-lib.el
index 5c955e0dac..7d19d7a4a8 100644
--- a/svg-lib.el
+++ b/svg-lib.el
@@ -4,7 +4,7 @@
 
 ;; Maintainer: Nicolas P. Rougier <Nicolas.Rougier@inria.fr>
 ;; URL: https://github.com/rougier/svg-lib
-;; Version: 0.2.3
+;; Version: 0.2.5
 ;; Package-Requires: ((emacs "27.1"))
 ;; Keywords: svg, icons, tags, convenience
 
@@ -67,6 +67,12 @@
 
 ;;; NEWS:
 
+;; Version 0.2.5
+;; - Bug fix in text size computation
+
+;; Version 0.2.4
+;; - Better error handling if SVG support is missing
+
 ;; Version 0.2.2
 ;; - Added a left/righ crop style argument to allow for tags collage.
 
@@ -87,9 +93,11 @@
 (require 'color)
 
 ;; Check if Emacs has been compiled with svg support
-(unless (image-type-available-p 'svg)
-  (error "svg-lib.el requires Emacs to be compiled with svg support.\n"))
-
+(defun svg-lib--image (&rest args)
+  ;; FIXME: Should `svg-image' perform this check instead?
+  (unless (image-type-available-p 'svg)
+     (error "svg-lib.el requires Emacs to be compiled with svg support.\n"))
+  (apply #'svg-image args))
 
 (defgroup svg-lib nil
   "SVG tags, bars & icons."
@@ -246,6 +254,7 @@ and style elements ARGS."
                               (+ txt-char-height line-spacing)
                             txt-char-height))
          (font-info       (font-info (format "%s-%d" font-family font-size)))
+         (font-size       (aref font-info 2)) ;; redefine font-size
          (ascent          (aref font-info 8))
          (tag-char-width  (aref font-info 11))
          ;; (tag-char-height (aref font-info 3))
@@ -276,7 +285,7 @@ and style elements ARGS."
     (svg-text svg label
               :font-family font-family :font-weight font-weight  :font-size 
font-size
               :fill foreground :x text-x :y  text-y)
-    (svg-image svg :ascent 'center)))
+    (svg-lib--image svg :ascent 'center)))
 
 
 ;; Create a progress pie
@@ -345,7 +354,7 @@ and style elements ARGS."
                     (elliptical-arc ((,iradius ,iradius ,x1 ,y1
                                       :sweep t :large-arc ,large-arc))))
               :fill foreground))
-    (svg-image svg :ascent 'center)))
+    (svg-lib--image svg :ascent 'center)))
 
 
 
@@ -402,7 +411,7 @@ and style elements ARGS."
                        (- tag-height stroke (* 2 padding))
                        :fill foreground :rx (- radius (/ stroke 2.0)))
     
-    (svg-image svg :ascent 'center)))
+    (svg-lib--image svg :ascent 'center)))
 
 
 
@@ -500,7 +509,7 @@ given STYLE and style elements ARGS."
         (svg-node svg 'path :d path
                             :fill foreground
                             :transform icon-transform)))
-    (svg-image svg :ascent 'center)))
+    (svg-lib--image svg :ascent 'center)))
 
 
 
@@ -587,7 +596,7 @@ and style elements ARGS."
         (svg-node svg 'path :d path
                             :fill foreground
                             :transform icon-transform)))
-    (svg-image svg :ascent 'center)))
+    (svg-lib--image svg :ascent 'center)))
 
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]