protonscr

generating dxvk_hud_font.cpp

dxvkclosed
doitsujin/dxvk#708 · opened 2018-10-16 by aviau · updated 2018-10-17 · 14 comments · github
Aaviau 2018-10-16 github

Hello!

I am currently working on packaging DXVK for Debian and I am not sure that we can include dxvk_hud_font.cpp in Debian since it was generated with software that we don't have and we must build everything from source.

Could we possibly build without hud support?

If not, could this functionality be added?

Cheers,

Ddoitsujin maintainer 2018-10-16 github

You're free to patch it out, but I'm not going to do it. If Debian has a stupid policy in place that prevents you from using a perfectly legal source file, then that's your problem, not mine.

TThaodan 2018-10-16 github

The issue is that debian was reproducible builds and wants source 100% the same if don't change the commit its based on.
There are other distros that do this too.

Ddoitsujin maintainer 2018-10-16 github

@Thaodan in what way does the HUD interfere with reproducible builds? What part of DXVK is problematic and why, and what needs to be changed in order to meet those requirements?

I genuinely don't understand what the problem is here.

TThaodan 2018-10-16 github

I just took a gues because that file is generated at build time and may change.

Ddoitsujin maintainer 2018-10-16 github

No, it's not. It was generated once and put into the project as a regular source file, like any other.

TThaodan 2018-10-16 github

Than sorry discard my comment. Than it doesn't make sense.

Aaviau 2018-10-16 github

If Debian has a stupid policy in place

Sorry if this sounds annoying to you. I am doing my best here and I am willing to help.

what the problem is here

Again, please bear with me. I'll explain my best.

We don't consider dxvk_hud_font.cpp "source code" because it cannot be modified by hand. I have not decided this rule.

Possible solutions could include:

  • excluding it from the source
  • generating dxvk_hud_font.cpp as part of the build process
  • patching dxvk_hud_font.cpp (only in Debian) in a way that wouldn't break the program but still build.

Could you help me understand how dxvk_hud_font.cpp is obtained from https://evanw.github.io/font-texture-generator/ and https://github.com/adobe-fonts/source-code-pro ?

Sorry if I came off as pointing that somehow DXVK wasn't legal. It has nothing to do with the legality of the project, it has to do with the Debian Free Software guidelines, that ask us to build everything from source and our definition of source code.

Ssaboya 2018-10-16 github

The last modification on that file was 7 months ago. What makes you think that it's going to change? It's not generated every commit, so your builds will be 100% reproducible.

Aaviau 2018-10-16 github

I have never mentionned reproducible builds, please read the comment above.

Eexolyte 2018-10-16 github

The g_hudFontImage array is just the C++ representation of an image generated by https://evanw.github.io/font-texture-generator/, this is not code so I don't think it should fall under software guidelines?

Aaviau 2018-10-17 github

this is not code so I don't think it should fall under software guidelines?

I'd be happy to explain how Debian policies work in another thread, if you want, but maybe we should keep this discussion about dxvk and not about Debian. Everything in Debian falls under the DFSG.

generated by https://evanw.github.io/font-texture-generator/

Can you provide a step-by-step guide on how to do that?

I don't understand how g_hudFontImage is generated.

For example, if I pick Arial and check "C", I get only:

  • Character characters_Arial[]
  • Font font_Arial
Aaviau 2018-10-17 github

I have got things working.

FWIW, for those interested, that would be the guide:

1. Launch debian/missing-source/font-texture-generator/index.html in
   a browser.

2. Select the data format: "C".

3. Save the provided image, and convert it to C:
    $ convert image.png image.h

4. Insert the generated image code in dxvk_hud_font.cpp as
   const uint8_t g_hudFontImage[].

5. Append the text generated by font-texture-generator to
   dxvk_hud_font.cpp, excluding the last constant.

6. Adapt the last constant to the following signature and append it
   to dxvk_hud_font.cpp.tmpl:
    - const HudFont g_hudFont = { int, int, int, int, int, int, g_hudFontGlyphs, g_hudFontImage };
TThaodan 2018-10-17 github

@aviau i said this because you don't fully explained this isn't code for debian. I think about stuff that changes during builtime. Maybe you can commit this to avoid that hassle.

Llieff 2018-10-17 github

@Thaodan But this file can't be changed during builtime.

Nothing extracted yet.