From 0e6ee5833d5da65ceed0be734f51e9fdccce86c0 Mon Sep 17 00:00:00 2001 From: Brandon McQueen Date: Fri, 28 Aug 2020 10:57:24 -0400 Subject: [PATCH] Assign font size as an attribute instead of css on --- src/InitialAvatar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/InitialAvatar.php b/src/InitialAvatar.php index 0d850f0..a3b931c 100644 --- a/src/InitialAvatar.php +++ b/src/InitialAvatar.php @@ -636,10 +636,10 @@ protected function makeSvgAvatar() { // Text $text = new SVGText( $this->getInitials(), '50%', '50%' ); $text->setFont( new SVGFont( $this->getFontName(), $this->findFontFile() ) ); - $text->setSize( $this->getFontSize() * $this->getWidth() ); $text->setStyle( 'line-height', 1 ); $text->setAttribute( 'dy', '.1em' ); $text->setAttribute( 'fill', $this->getColor() ); + $text->setAttribute('font-size', $this->getFontSize() * $this->getWidth()); $text->setAttribute( 'text-anchor', 'middle' ); $text->setAttribute( 'dominant-baseline', 'middle' ); @@ -738,4 +738,4 @@ protected function getFontByScript() { return $this->getFontFile(); } -} \ No newline at end of file +}