Comments (6)
@balin09 could you provide some sample code?
And also, how is your current output? Does it still display text in latin?
from avatar.
@uyab here some code
avatar.php:
`
'driver' => env('IMAGE_DRIVER', 'gd'),
// Initial generator class
'generator' => \Laravolt\Avatar\Generator\DefaultGenerator::class,
// Whether all characters supplied must be replaced with their closest ASCII counterparts
'ascii' => false,
// Image shape: circle or square
'shape' => 'square',
// Image width, in pixel
'width' => 100,
// Image height, in pixel
'height' => 70,
// Number of characters used as initials. If name consists of single word, the first N character will be used
'chars' => 2,
// font size
'fontSize' => 38,
// convert initial letter in uppercase
'uppercase' => true,
'rtl' => false,
// Fonts used to render text.
// If contains more than one fonts, randomly selected based on name supplied
'fonts' => [__DIR__ . '/../fonts/Tajawal-Medium.ttf'],
// List of foreground colors to be used, randomly selected based on name supplied
'foregrounds' => [
'#FFFFFF',
],
...
`
call avatar
img class="rounded-full" src="{{ Avatar::create($user['fname'].$user['lname'])->toBase64() }}" alt="User image"
and here the ouptput:
from avatar.
anyone try this plugin and worked with Arabic language ?
from avatar.
I downloaded (hopefully) the same font from https://www.fontpalace.com/font-download/tajawal-medium/ and its just works as expected.
Can you validate if you have setup the fonts path correctly? Something like dd(config('laravolt.avatar.fonts'))
and see if the output was correct.
from avatar.
@uyab
So sorry for late response
my bad i get confused with font path in avatar.php i thought it was correct ..., now it worked fine when i change it.
but now i have an other problem: with arabic name it take 2 initial from first name only, exp for ( Imad Abd ) i expect [I A] but i get [Im].
here is the output
even with english sometimes the same probleme happen:
and also the output for rtl=>true or false ar the same for english and arabic here is my config
from avatar.
You can create your own InitialGenerator class. Please check the configuration file.
from avatar.
Related Issues (20)
- Theme decorator in config file HOT 1
- Class name must be a valid object or a string HOT 16
- Text is not centered horizontally HOT 2
- is there a way to create an avatar out of a number ? HOT 5
- How heavy is the process? HOT 2
- Right to left script support HOT 8
- Laravel 8.x Support HOT 3
- Serialization of 'GdImage' is not allowed HOT 4
- setTheme() border size bug HOT 3
- config is empty when using facade HOT 1
- Generates only default "background" and "foreground" color
- Laravel 9 support HOT 4
- Using SVG with & (ampersand) breaks XML
- font error HOT 1
- got this error HOT 3
- error while install Laravolt HOT 2
- SVGs have their width and height set rendering them unresponsive HOT 1
- Error using in Laravel Framework 9.47.0, Please help !!! HOT 1
- Laravel 10 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avatar.