Php Initial Avatar Generator Versions Save

Generate avatars with initials from user names.

2.2.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

Can now detect language/script and apply a font that supports that script/language.

Supported:

  • Arabic
  • Armenian
  • Bengali
  • Georgian
  • Hebrew
  • Mongolian
  • Thai
  • Tibetan

More will come, when more supporting fonts are found.

2.0.8

6 years ago

Will now NOT default to __DIR__ . $fontFile but instead use it as a fallback.

This also means you can specify in an integer for GD Internal fonts or a complete path. Current implementations should still work, as it will simply fallback to the old implementation if no font is found.

2.0.7

6 years ago

I found a way to solve the ugly circle when using rounded(). Now, by using smooth() as well, it will generate a avatar at 5x size (without text) and resize back after the circle has been created. Example below:

Before: download 2

After: download 1

As you can see, the text is unchanged but the circle is far smoother. Use this and supply a avatar double the size of the img tag, and you will get some crisp avatars. 👍

Double size of img tag:

Smooth + double size of img tag:

v2.0.6

6 years ago

After seeing https://github.com/sybri/php56-initial-avatar-generator, I decided to add php 5.6 support. Thanks!

v2.0.5

7 years ago

It's now possible to use Japanese letters, with a different font.

<?php

require_once 'vendor/autoload.php';

$avatar = new LasseRafn\InitialAvatarGenerator\InitialAvatar();

echo $avatar->font('/fonts/NotoSans-Medium.otf')
            ->generate('こんにちは')
            ->stream('data-url');

v2.0

7 years ago

v1.2

7 years ago

Can now generate rounded images, however you should default to using border-radius using CSS instead.

v1.1

7 years ago

I've fixed some stuff, added some docblocks, written more tests and setup monitoring and more.