EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Question about the font name for EDM
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: lzf neu <lzfneu at live.com>
Cc: 米清茹 <miqingru at sinap.ac.cn>, EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Thu, 31 Dec 2020 16:40:59 -0800
Back in the day (2009) I looked into the arcane details of X fonts.

My first piece of advice is to begin migrating from EDM to
something less ancient.  cs-studio, pydm, or caqtdm are all options.
There are some .edl file converters available.  My recent experience
with the converting in cs-studio/phoebus was good.  It mostly just worked.

https://control-system-studio.readthedocs.io/en/latest/app/display/convert-medm/doc/index.html#converting-edm-edl-displays

My second suggestion is to simply remove the offending lines from
the font.list file.  This is a list of available fonts, not all
of which are used by any particular set of .edl files.  As I recall,
the default is usually "helvetica", you may not need the "schoolbook" fonts.

If you really need to get into the details.

The 'xlsfonts' executable will output a list of fonts in the current X server search path

> $ xlsfonts -fn '-*-*-*-*-*-*-*-*-75-75-*-*-*-*'

I wrote a script to transform this output into the EDM font list format.
My notes for using it say:

> $ cat << EOF > fonts.list
> 3 0 0
> helvetica-medium-r-12.0
> helvetica-medium-r-18.0
> EOF
> $ xlsfonts -fn '-*-*-*-*-*-*-*-*-75-75-*-*-*-*' | ./fontparse.py >> fonts.list

https://github.com/epicsdeb/edm/blob/master/debian/patches/0004-fixup-font-list-for-Debian.patch

I'm also attaching the script file without the diff markup.

Running on my (Debian 10) laptop now gives the following.  I have the "xfonts-75pi" package install.

> 3 0 0
> helvetica-medium-r-12.0
> helvetica-medium-r-18.0
> charter=-*-charter-(medium,bold)-(r,i)-normal--*-(80,100,120,140,180,240)-75-75-p-*-*-*
> helvetica=-*-helvetica-(medium,bold)-(r,i,o)-(narrow,normal)--*-(80,100,120,140,180,240)-75-75-p-*-*-*
> new century schoolbook=-*-new century schoolbook-(medium,bold)-(r,i)-normal--*-(80,100,120,140,180,240)-75-75-p-*-*-*
> lucidabright=-*-lucidabright-(medium,demibold)-(r,i)-normal--*-(80,100,120,140,180,190,240)-75-75-p-*-*-*
> lucida=-*-lucida-(medium,bold)-(r,i)-normal-sans-*-(80,100,120,140,180,190,240)-75-75-p-*-*-*
> courier=-*-courier-(medium,bold)-(r,i,o)-normal--*-(80,100,120,140,180,240)-75-75-(p,m)-*-*-*
> lucidatypewriter=-*-lucidatypewriter-(medium,bold)-r-normal-sans-*-(80,100,120,140,180,190,240)-75-75-m-*-*-*
> times=-*-times-(medium,bold)-(r,i)-normal--*-(80,100,120,140,180,240)-75-75-p-*-*-*
> clean=-*-clean-(medium,bold)-(r,i)-normal--*-(60,80,100,120,130,140,150,160)-75-75-c-*-*-*
> fixed=-*-fixed-(medium,bold)-(r,o)-(semicondensed,normal)-(,ko,ja)-*-(60,70,80,90,100,110,120,130,140,150,200,230)-75-75-c-*$


Good luck!



On 12/31/20 10:42 AM, Johnson, Andrew N. via Tech-talk wrote:
> On Dec 29, 2020, at 8:58 PM, lzf neu via Tech-talk <tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>> wrote:
>>
>> I have tried but the same problem still exists.
>>
>> Maybe my updated CentOS 7 system is lack of "century schoolbook font", the corresponding font package I searched in the web is "texlive-palatino-svn28614.0-45.el7.noarch.rpm".
>> However, when I yum install it, the terminal gives the following information: 
>> Package 2:texlive-palatino-svn28614.0-45.el7.noarch already installed and latest version.
>>
>> I have no idea what the problem  is. 
> 
> On my RHEL-7 system the Century Schoolbook fonts are called “new century schoolbook” (your error message doesn’t have “new” in the name) and are installed in these standard X11 packages:
> 
>> xorg-x11-fonts-75dpi-7.5-9.el7.noarch
>> xorg-x11-fonts-100dpi-7.5-9.el7.noarch
> 
> etc. You almost certainly have those installed, so my question is why edm is looking for “century schoolbook” instead of “new century schoolbook”. Our (now very old) installation of edm has this line in the edmMain/fonts.list file
> 
>> new centuryschoolbook=-*-centuryschoolbook l-(medium,bold)-(r,i)-normal--0-(80,90,100,110,120,140,180,240,320,480,720)-75-75-p-0-*-*
> 
> but these lines in the setup/fonts.list file:
> 
>> -adobe-new century schoolbook-bold-i-normal--8-80-75-75-p-56-iso8859-1
>> -adobe-new century schoolbook-bold-i-normal--10-100-75-75-p-66-iso8859-1
>> -adobe-new century schoolbook-bold-i-normal--12-120-75-75-p-76-iso8859-1
>> -adobe-new century schoolbook-bold-i-normal--14-140-75-75-p-88-iso8859-1
>> -adobe-new century schoolbook-bold-i-normal--18-180-75-75-p-111-iso8859-1
>> -adobe-new century schoolbook-bold-i-normal--24-240-75-75-p-148-iso8859-1
>> -adobe-new century schoolbook-bold-r-normal--10-100-75-75-p-66-iso8859-1
>> -adobe-new century schoolbook-bold-r-normal--12-120-75-75-p-77-iso8859-1
>> -adobe-new century schoolbook-bold-r-normal--14-140-75-75-p-87-iso8859-1
>> -adobe-new century schoolbook-bold-r-normal--18-180-75-75-p-113-iso8859-1
>> -adobe-new century schoolbook-bold-r-normal--24-240-75-75-p-149-iso8859-1
>> -adobe-new century schoolbook-bold-r-normal--8-80-75-75-p-56-iso8859-1
>> -adobe-new century schoolbook-medium-i-normal--10-100-75-75-p-60-iso8859-1
>> -adobe-new century schoolbook-medium-i-normal--12-120-75-75-p-70-iso8859-1
>> -adobe-new century schoolbook-medium-i-normal--14-140-75-75-p-81-iso8859-1
>> -adobe-new century schoolbook-medium-i-normal--18-180-75-75-p-104-iso8859-1
>> -adobe-new century schoolbook-medium-i-normal--24-240-75-75-p-136-iso8859-1
>> -adobe-new century schoolbook-medium-i-normal--8-80-75-75-p-50-iso8859-1
>> -adobe-new century schoolbook-medium-r-normal--10-100-75-75-p-60-iso8859-1
>> -adobe-new century schoolbook-medium-r-normal--12-120-75-75-p-70-iso8859-1
>> -adobe-new century schoolbook-medium-r-normal--14-140-75-75-p-82-iso8859-1
>> -adobe-new century schoolbook-medium-r-normal--18-180-75-75-p-103-iso8859-1
>> -adobe-new century schoolbook-medium-r-normal--24-240-75-75-p-137-iso8859-1
>> -adobe-new century schoolbook-medium-r-normal--8-80-75-75-p-50-iso8859-1
> 
> Did you perhaps miss a step when installing edm?
> 
> - Andrew
> 
> 
> 
>> *发件人:* 米清茹 <miqingru at sinap.ac.cn <mailto:miqingru at sinap.ac.cn>>
>> *发送时间:* 2020年12月30日 1:39
>> *收件人:* tech-talkepics <tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>>; lzfneu <lzfneu at live.com <mailto:lzfneu at live.com>>
>> *主题:* Re: Question about the font name for EDM
>>  
>> Hi, neu
>>     A softlinked file can be built after 75dpi installed with yum.
>>     # ln -s /usr/share/X11/fonts/75dpi /etc/X11/fontpath.d/75dpi
>>     
>>     100dpi can be built in the same way.
>>
>>     I have used this way on any centos7 version.
>>     
>>
>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> *Mi Qingru*
>> *SARI CAS*
>>
>>      
>>     *From:* tech-talk-request <mailto:tech-talk-request at aps.anl.gov>
>>     *Date:* 2020-12-30 02:00
>>     *To:* tech-talk <mailto:tech-talk at aps.anl.gov>
>>     *Subject:* Tech-talk Digest, Vol 14, Issue 665
>>     Send Tech-talk mailing list submissions to
>>
>>      
>>     Message: 1
>>     Date: Tue, 29 Dec 2020 04:07:56 +0000
>>     From: lzf neu <lzfneu at live.com <mailto:lzfneu at live.com>>
>>     To: EPICS tech-talk <tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>>
>>     Subject: Question about the font name for EDM
>>     Message-ID:
>>     <MEAP282MB02312A19296520963A534202ADD80 at MEAP282MB0231.AUSP282.PROD.OUTLOOK.COM <mailto:MEAP282MB02312A19296520963A534202ADD80 at MEAP282MB0231.AUSP282.PROD.OUTLOOK.COM>>
>>     Content-Type: text/plain; charset="gb2312"
>>      
>>     Deal all,
>>     Recently I have update centos 7 to the version: CentOS Linux release 7.8.2003 (Core)
>>     However, edm cannot be run correctly as before, the new problem is as follows when typing edm command in the terminal:
>>      
>>     No such font available: [-*-century schoolbook l-medium-r-normal--0-80-75-75-p-0-*-*]
>>     Last line processed: 12
>>     Font init failed - abort
>>      
>>     I have already set the following command in bashrc:
>>     xset fp+ /usr/share/X11/fonts/75dpi
>>      
>>     and the problem still occurs.
>>      
>>     Maybe I should install new font and I have no idea what the font name is I should type using yum install command.
>>     Thank you in advance.
>>      
>>     -------------- next part --------------
>>     An HTML attachment was scrubbed...
>>     URL: <http://mailman.aps.anl.gov/pipermail/tech-talk/attachments/20201229/ca27a861/attachment.html <http://mailman.aps.anl.gov/pipermail/tech-talk/attachments/20201229/ca27a861/attachment.html>>
>>      
>>     ------------------------------
>>      
>>     Subject: Digest Footer
>>      
>>     _______________________________________________
>>     Tech-talk mailing list Tech-talk at aps.anl.gov <mailto:Tech-talk at aps.anl.gov>
>>     https://mailman.aps.anl.gov/mailman/listinfo/tech-talk <https://mailman.aps.anl.gov/mailman/listinfo/tech-talk>
>>      
>>      
>>     ------------------------------
>>      
>>     End of Tech-talk Digest, Vol 14, Issue 665
>>     ******************************************
>>
> 
> -- 
> Complexity comes for free, simplicity you have to work for.
> 

#!/usr/bin/env python

# EDM magic font script
# Michael Davidsaver <mdavidsaver at bnl.gov>
# 20091113
#
# $ cat << EOF > fonts.list
# 3 0 0
# helvetica-medium-r-12.0
# helvetica-medium-r-18.0
# EOF
# $ xlsfonts -fn '-*-*-*-*-*-*-*-*-75-75-*-*-*-*' | ./fontparse.py >> fonts.list
#

import sys,re
from collections import defaultdict

inp=sys.stdin
outp=sys.stdout

xfontpat='-([^-]*)'
xfont=re.compile(xfontpat)

#print >>sys.stderr, 'Matching',xfontpat

fset = defaultdict(list)

# read and store by family

melem=0
for line in inp.readlines():

	#remove '\n'
	line=line[:-1]

	spec = xfont.findall(line)

	if len(spec)<14:
#		print >>sys.stderr, 'invalid spec?',line
		continue

	fset[spec[1]].append(spec)
	melem=max(melem, len(spec))

#	print >>sys.stderr, spec

print >>sys.stderr, 'Found',len(fset.keys()),'Families'
for family in fset.keys():

	print >>sys.stderr, '\nfamily',family,'has',len(fset[family]),'fonts'
	
	# These aren't practically usable
	if len(fset[family]) < 32:
		print >>sys.stderr, "Too small, skipping..."
		del fset[family]


# digest and group be field

for family in fset.keys():

	fspecs = map(lambda x:set(),range(melem))

	for fn in fset[family]:
#		print fn
		for i in range(len(fn)):
#			print i,fn[i],fspecs[i]
			fspecs[i].add(fn[i])

	fspecs=map(list,fspecs)

	# X11 font spec
	#   fields
	# 0 - foundry
	# 1 - family (ie times or helvetica)
	# 2 - weight (bold)
	# 3 - slant (r = normal,i , o)
	# 4 - setwidth (normal, condensed)
	# 5 - addedstyle (usually empty '')
	# 6 - pixelsize (usually all '*')
	# 7 - point size
	# 8 - resx  (75 or 100)
	# 9 - resy
	#10 - space (m = mono, p = propor, c = cell)
	#11 - average width
	#12 - registry
	#13 - encoding

	# -*-*-*-*-*-*-*-*-75-75-*-*-*-*

	fspecs[0]=['*']

	# ensure that the ordering is correct
	slant=[]
	for s in 'rio':
		if s in fspecs[3]:
			slant.append(s)
	fspecs[3]=slant

	#fspecs[5]=['']
	fspecs[6]=['*']
	fspecs[11]=['*']
	fspecs[12]=['*']
	fspecs[13]=['*']

	# EDM likes only 75 dpi fonts

	fspecs[8]=['75']
	fspecs[9]=['75']

	# sort numeric fields and remove 0's

	for i in [7]:
		d=fspecs[i]

		val=map(int,d)
		val.sort()
		val=filter(lambda x:x!=0,val)
		d=map(str,val)

		fspecs[i]=d

	#print fspecs


	# Create the spec line
	# -*-*-*-*-*-...
	ln=''
	for field in fspecs:

		ln=ln+'-'

		if len(field)==0:
			# empty fields '--'
			pass
		elif len(field)==1:
			# single fields '-val-'
			ln=ln+str(field[0])
		else:
			# group fields '-(a,b,c)-'
			s=reduce(lambda a,b:a+b, map(lambda x:x+',',field),'')
			s=s[:-1] # drop last ','
			ln=ln+'(%s)' % s

#	print ln

	outp.write('%s=%s\n'%(family,ln))

Replies:
Re: Question about the font name for EDM Lauritsen, Torben via Tech-talk

Navigate by Date:
Next: Re: Question about the font name for EDM Lauritsen, Torben via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Next: Re: Question about the font name for EDM Lauritsen, Torben via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 03 Jan 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·