Mixed font label?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
gerardsweeney

Mixed font label?

Post by gerardsweeney »

Hello, all..

I am trying to create a small Win32 BAT script which will append some basic PC info onto the wallpaper of the user logged in.

Every user has their own wallpaper, which is why I'm not just pointing everyone to a unilateral one with the information (in case anyone was interested - heh).

Here's what I have so far:

Code: Select all

convert -background "#00000080" -fill white ^
-pointsize 12 label:"\n" ^
-pointsize 36 label:"  System name: %COMPUTERNAME%  " ^
-pointsize 12 label:"\n" ^
-pointsize 22 label:"   Make/Model: Hewlett-Packard HP Compaq 6910p  " ^
-pointsize 22 label:"   Serial Number: ABCDEFG123  " ^
-pointsize 12 label:"\n" ^
-pointsize 22 label:"   User name: %USERNAME%  " ^
-pointsize 12 label:"\n" ^
-append ^
-alpha set -virtual-pixel transparent ^
-channel A -blur 0x8  -level 50%,100% +channel ^
miff:- |^
composite -gravity south -geometry +0+3 ^
- usercurrentwallpaper.bmp UserNewWallpaper.bmp
Which gets me something like:
System name: PCNAMEHERE

Make/model: Hewlett-Packard HP Compaq 6910p
Serial Number: ABCDEFG

User name: USERNAMEHERE

So far, so good. However I would like to change it so it looks like:

System name: PCNAMEHERE

Make/model: Hewlett-Packard HP Compaq 6910p
Serial Number: ABCDEFG

User name: USERNAMEHERE

But I seem to be running into a brick wall trying to append labels horizontally AND vertically.

I don't really care if I have to use some other format other than label - I'd just quite like it to work :)

I've looked at the various text format examples on Anthony's site, but I can't seem to find one which does this mix and match.

Does anyone have any pointers?

Kind regards,
Gerard
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Mixed font label?

Post by anthony »

You should use a different font for the bold parts.

See using Mixed fonts.
http://www.imagemagick.org/Usage/text/#mixed_font_lines

An easier way is just annotate directly onto the background image, that way you can just position each 'style' of text exactly where you want it.

Also see the IM Example sections on Compound Fonts, and Annotations for ways of making a font more visible on a unknown image.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply