#21143 closed defect (fixed)
"Could not create font Sans"
Reported by: | rickmastfan67 | Owned by: | team |
---|---|---|---|
Priority: | minor | Milestone: | 21.07 |
Component: | Core | Version: | latest |
Keywords: | svg font | Cc: | DevCharly, skyper, Klumbumbus |
Description
Just happened to notice this error show up multiple times in the CL window when I updated my copy of JOSM (hadn't updated in a few days).
2021-07-20 02:28:31.077 INFO: Log level is at INFO (INFO, 800) 2021-07-20 02:28:34.120 INFO: Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled. 2021-07-20 02:28:35.737 INFO: GET https://api.openstreetmap.org/api/0.6/user/details -> HTTP/1.1 200 (505 ms; 891 B) 2021-07-20 02:28:35.929 WARNING: Could not create font Sans 2021-07-20 02:28:35.937 WARNING: Could not create font Sans 2021-07-20 02:28:35.967 WARNING: Could not create font Sans 2021-07-20 02:28:35.985 WARNING: Could not create font Sans 2021-07-20 02:28:37.066 INFO: Obtained 82 Tag2Link rules from resource://META-INF/resources/webjars/tag2link/2021.3.21/index.json 2021-07-20 02:28:37.958 WARNING: Could not create font Sans 2021-07-20 02:28:37.959 WARNING: Could not create font Sans 2021-07-20 02:28:37.960 WARNING: Could not create font Sans 2021-07-20 02:28:37.961 WARNING: Could not create font Sans 2021-07-20 02:28:37.961 WARNING: Could not create font Sans 2021-07-20 02:28:37.962 WARNING: Could not create font Sans 2021-07-20 02:28:37.962 WARNING: Could not create font Sans 2021-07-20 02:28:37.963 WARNING: Could not create font Sans
So, I did some testing to find the possible regression window.
r18068 didn't have this error, but r18070 did have it. So, I'm guessing something in [18070] produced the error above.
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2021-07-20 00:45:25 +0200 (Tue, 20 Jul 2021) Build-Date:2021-07-20 01:31:02 Revision:18077 Relative:URL: ^/trunk Identification: JOSM/1.5 (18077 en) Windows 7 64-Bit OS Build number: Windows 7 Professional (7601) Memory Usage: 511 MB / 1820 MB (388 MB allocated, but free) Java version: 1.8.0_201-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 1920×1080 (scaling 1.00×1.00) Maximum Screen Size: 1920×1080 Best cursor sizes: 16×16→32×32, 32×32→32×32 System property file.encoding: Cp1252 System property sun.jnu.encoding: Cp1252 Locale info: en_US Numbers with default locale: 1234567890 -> 1234567890 Plugins: + OpeningHoursEditor (35640) + buildings_tools (35756) + measurement (35640) + reverter (35732) + tageditor (35640) + turnlanes-tagging (288) + turnrestrictions (35640) + undelete (35640) + utilsplugin2 (35792)
Attachments (1)
Change History (45)
comment:1 by , 3 years ago
Cc: | added |
---|---|
Keywords: | svg font windows added |
comment:2 by , 3 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 3 years ago
Cc: | added |
---|
comment:4 by , 3 years ago
Milestone: | → 21.07 |
---|---|
Owner: | changed from | to
Status: | assigned → new |
comment:5 by , 3 years ago
Component: | Core → Internal preset |
---|
33 icons impacted:
$ find . -name "*.svg" | xargs grep "font-family:Sans" | cut -d':' -f1 | sort -u ./images/presets/health/clinic.svg ./images/presets/health/dentist.svg ./images/presets/health/doctors.svg ./images/presets/leisure/club.svg ./images/presets/misc/pipeline_marker.svg ./images/presets/office/accountant.svg ./images/presets/office/advertising_agency.svg ./images/presets/office/architect.svg ./images/presets/office/association.svg ./images/presets/office/diplomatic.svg ./images/presets/office/educational_institution.svg ./images/presets/office/employment_agency.svg ./images/presets/office/foundation.svg ./images/presets/office/government.svg ./images/presets/office/insurance.svg ./images/presets/office/it.svg ./images/presets/office/lawyer.svg ./images/presets/office/newspaper.svg ./images/presets/office/notary.svg ./images/presets/office/ong.svg ./images/presets/office/political_party.svg ./images/presets/office/private_company.svg ./images/presets/office/real_state.svg ./images/presets/office/religion.svg ./images/presets/office/research.svg ./images/presets/office/tax_advisor.svg ./images/presets/office/telecommunication.svg ./images/presets/social_facility/assisted_living.svg ./images/presets/social_facility/group_home.svg ./images/presets/social_facility/nursing_home.svg ./images/presets/social_facility/outreach.svg ./images/presets/social_facility/shelter.svg ./images/presets/transport/way/way_pedestrian.svg
comment:6 by , 3 years ago
Priority: | normal → minor |
---|
follow-up: 8 comment:7 by , 3 years ago
It seems to depend on the operating system and/or the installed fonts. Actually, I prefer "Sans" over "Serif" as it is better readable, especially, if small.
Actually, I do not really understand why the font is involved here as many of these icons do not include letters.
Does removing font-family:Sans;
from the style=""
within the the svg file solve this?
comment:8 by , 3 years ago
Replying to skyper:
Does removing
font-family:Sans;
from thestyle=""
within the the svg file solve this?
Probably. We only have 80 icons out of 1212, with a "font-family" directive.
comment:9 by , 3 years ago
By the way, inkscape changes the DPI from 90 to 96 which seems to be better for displaying on screens.
comment:10 by , 3 years ago
Didn't we have that one font which is shipped with JOSM "Droid Sans"? So that's different from "Sans" I guess?
Does removing font-family:Sans; from the style="" within the the svg file solve this?
Yes we should start with that and see how much icons will be left.
comment:11 by , 3 years ago
Oh, now I get the warnings, too. But not only "Sans" but also "Calibri" and "Bookman Old Style".
comment:12 by , 3 years ago
Keywords: | windows removed |
---|
comment:13 by , 3 years ago
Owner: | changed from | to
---|
comment:15 by , 3 years ago
comment:21 by , 3 years ago
These 12 icon with a font-family
are left:
images\offline_osm_api.svg images\data\imagery\osmbasedmap.svg images\data\projection\Departements_Lambert4Zones.svg images\data\projection\LambertCC9Zones.svg images\presets\leisure\billboard.svg images\presets\misc\angles.svg images\presets\misc\pipeline_marker.svg images\presets\service\internet_cafe.svg images\presets\shop\kiosk.svg images\presets\shop\lottery.svg images\presets\sport\billiards.svg images\presets\sport\volleyball.svg
How to proceed? I guess the only save to use fonts are DroidSans and DroidSans-Bold? What would be the font-family
attribute for them? "DroidSans" ?
comment:22 by , 3 years ago
Should the "text-*" & "letter-*" tags also be removed too since the there's no words in the files? I really only noticed those tags in the files edited in [18083] to be honest.
comment:23 by , 3 years ago
by , 3 years ago
Proposal to drop text from kiosk.svg icon (dropping useless text and converting NEWS to path)
comment:28 by , 3 years ago
Owner: | changed from | to
---|
There are 4 icons with text elements left which use all Droid Sans as font now, so I guess this ticket is fixed for now.
images\data\projection\Departements_Lambert4Zones.svg images\data\projection\LambertCC9Zones.svg images\presets\misc\angles.svg images\presets\misc\pipeline_marker.svg
The question is how to handle new icons? Only allow text if the font is Droid Sans in normal or bold?
follow-up: 31 comment:29 by , 3 years ago
If decided I can adapt the geticons.pl script to warn about unwanted things. Please tell me what I should detect then :-)
comment:30 by , 3 years ago
btw, the osm icon (images\data\imagery\osmbasedmap.svg and images\offline_osm_api.svg) is not correctly displayed in JOSM, the shadow of the magnifier is a hard line. This can't be seen at 24px or smaller but is already visible at 48px.
comment:31 by , 3 years ago
Replying to stoecker:
If decided I can adapt the geticons.pl script to warn about unwanted things. Please tell me what I should detect then :-)
- If the script is able to parse SVG, any occurrence of a
style=
attribute with a value containingfont-
not set on atext
tag is suspicious - otherwise, if the file contains
font-
but not<text
, it should be enough to detect unneeded font properties
comment:32 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 35 comment:34 by , 3 years ago
One error remains:
> scripts/geticons.pl logo_macOS.png: Unused image.
comment:35 by , 3 years ago
Replying to stoecker:
One error remains:
> scripts/geticons.pl logo_macOS.png: Unused image.
False positive? https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java#L86
comment:38 by , 3 years ago
Replying to Klumbumbus:
Can we run geticons.pl automatically on Jenkins?
It's already part of JOSM-Integration and creates a file icons.txt.
I have no idea were you get results of this. Vincent?
comment:39 by , 3 years ago
Something must be broken, I thought to have integrated it but the logo_macOS error should have been reported for months. Looking into it.
comment:40 by , 3 years ago
Yep, the check is run but the results are no longer reported, probably when related Jenkins plugins have been deprecated in favour of new ones, I forgot to scan this one:
https://josm.openstreetmap.de/jenkins/job/JOSM-Integration/ws/jdk/JDK8/icons.txt
comment:41 by , 3 years ago
It should work now. The build should become unstable in case of issues reported by the script.
comment:43 by , 3 years ago
Component: | Internal preset → Core |
---|
comment:44 by , 3 years ago
The change generates lots of console warnings in combination with the style Traffic Signs_DE (version 5.2020-10-09 tested), because the contained svgs make use of font-family directives trying to load exotic fonts like
- 'DIN 1451 Mittelschrift'
- 'HelveticaNeue LT 45 Light'
- 'HelveticaNeue LT 75 Bold'
that might not be installed on a system running JOSM.
Since the style is not hosted here, it may be a good idea if someone opens a bug on the projects website to raise awareness of this problem.
svgSalamander font loading code in our old code base:
https://josm.openstreetmap.de/browser/josm/trunk/src/com/kitfox/svg/Text.java?rev=18069#L287
svgSalamander font loading code in the new code base:
https://github.com/JFormDesigner/svgSalamander/blame/master/svg-core/src/main/java/com/kitfox/svg/Text.java#L297
I guess we need to check our SVG icons which use the font "Sans" and use another font.