rackslab / Slurm-web

Open source web dashboard for Slurm HPC clusters
https://slurm-web.com
GNU General Public License v3.0
292 stars 86 forks source link

Show racks names in 3D view #80

Closed mehdid closed 8 years ago

robink commented 8 years ago

Au dessus du rack en mode panneau avec une largeur, quelque chose de soft

rezib commented 8 years ago

The introduction of file js/fonts/helvetiker_regular.typeface.js is not great... It must considered as a binary file w/o source file.

We must either find a way to:

rezib commented 8 years ago

For this issue, we just expect a nodejs command to build the *.typeface.js file from a source font file in order to generate it at build time.

rezib commented 8 years ago

Just developed a debian package for opentype.js, as requested: https://github.com/edf-hpc/opentypejs

rezib commented 8 years ago

My bad, re-opened because still missing the command to build the font.

rezib commented 8 years ago

There is a license issue with helvetiker font which seems to be a proprietary font indeed. The font must be removed from git repo.

Also, it would be better all the hard-coded references to the font could be removed in the code, as I'm seeing this currently:

js/modules/3d-view/iframe.js:    helvetiker: '../../../js/fonts/helvetiker_regular.typeface',
js/modules/3d-view/iframe.js:    helvetiker: {
js/modules/3d-view/iframe.js:      exports: 'helvetiker',
js/draw/3d-draw.js:  'helvetiker'
js/draw/3d-draw.js:          font: 'helvetiker',

I think a good option is to use dejavu fonts from this debian package: https://packages.debian.org/jessie/fonts-dejavu-core

This way, we can remove font from slurm-web git repository and directly use those provided by this package.

rezib commented 8 years ago

According to @Aenohe it's possible to drop font path in dashboard conf. That's definitely what must be done, it would be perfect then!

rezib commented 8 years ago

We're still expecting the following things:

rezib commented 8 years ago

We converted standard open source font DejaVuSans with your script from https://github.com/derniercri/font4three and opentype.js 0.4.3, using this command:

nodejs /usr/lib/nodejs/font-converter.js /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf > js/fonts/DejaVuSans.typeface.js

But when we try to use it, no rack name show up and we get this error in firefox development console:

SyntaxError: unterminated string literal DejaVuSans.typeface.js:2:988413
uncaught exception: The font DejaVu Sans with normal weight and normal style is missing.

The original TTF file can be found in this package: https://packages.debian.org/jessie/fonts-dejavu-core The resulting typeface font is: DejaVuSans.typeface.js.zip

How to fix this?

Lorel commented 8 years ago

the font DejaVu Sans Mono works, try this one

rezib commented 8 years ago

It's finally OK with DejaVu Sans Mono.