Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: to have label without background image #1386

Closed
eturpault opened this issue Feb 12, 2023 · 11 comments · Fixed by #1402
Closed

Feature request: to have label without background image #1386

eturpault opened this issue Feb 12, 2023 · 11 comments · Fixed by #1402

Comments

@eturpault
Copy link
Contributor

Currently in GrandOrgue a label must have necessarily a background image (built-in image defined with the attribute DispImageNum or external image defined by the attribute Image). This request is to add the possibility to define a label without background image, so only displaying the text defined in the attribute Name.
Some Hauptwerk sample sets have labels displayed without background image. In order to render them in GrandOrgue, OdfEdit has to use a built-in backgroupd, which is not beautiful.
In the image below on the left what should be obtained thanks to this feature request, on the right what is currently obtained with GO and a sample set converted from HW :
label without background

@rousseldenis
Copy link
Contributor

@eturpault Isn't this possible with using images with no background property (and transparency) ?

@eturpault
Copy link
Contributor Author

Yes theorically it is a feasible solution that I had in mind, the problem that I see with this solution would be for the placement of the text. It is placed by GO at the center of the image area, it may be difficult to manage the placement with the different lengths and sizes of text inside a transparent image which has a unique size. The goal of this request is also to avoid to have to place in the sample set an additional image which is not natively included. I think that it should be easier to make a change in GO SW to simply display a text without associated background image.
In OdfEdit I used a similar solution to have silent pipe (this discussion) by using a "transparent" sound sample, this is easier to manage that having to place graphically a text with variable length and size within a transparent image which has a fixed size. But I don't like this solution which obliges to add an external wav file in the sample set folder.

@larspalo
Copy link
Contributor

There are more than one way to implement this in GO as a feature (not considering the workaround already possible for a sample set creator to just add a transparent image).

We can fairly easily just add a new label style (DispImageNum) with number 13 that's just a blank transparent .png. The attributes of width, height etc for a GUILabel is already in place to control the exact size and extent and flow of text.

Another possibility that requires much more work is to allow naming the Image as TRANSPARENT and create the wxBitmap on the fly according to specifications of width, height etc. Or if they are blank calculate it from the text extent of the label Name.

I'm leaning more towards the first option as it's very easy to implement...

@oleg68
Copy link
Contributor

oleg68 commented Feb 16, 2023

@larspalo I like the second option more, because implementing the first one would require us to create a size management that would not be necessary with other 12 images.

@larspalo
Copy link
Contributor

@oleg68 How do you mean size management? The width and height attributes are already in place (label images are tiling).

@larspalo
Copy link
Contributor

@oleg68 Actually, after a quick test I think you're right. GO has trouble drawing a completely transparent image as a built in bitmap (it gets totally black). If there's at least one pixel of not complete transparency (it's still invisible but anyway there) it works. So, a better solution seems to be using a special naming of the Image line and then creating the bitmap programmatically.

@eturpault
Copy link
Contributor Author

I don't know the wxWidgets library used by GO, but is it really simpler to display a text with a transparent background image to generate programmatically than to display a text without nothing more ?
About the placement of the text, do you intend to use the DispXpos/DispYpos attributes ? Will the text be centered on this position ?

@larspalo
Copy link
Contributor

@eturpault The thing is that to just add text we'd need to add another odf type section, while modifying the GUI Label is just re-using an existing that already has more or less everything we need to get this done.

If we go with the method Oleg (and I now also consider) suggested, all the label attributes will be available. But what we also can do is to calculate the exact text extent and set/fill the values of width and height if they are blank. That would mean that the positioning would be rather at top/left corner than the center if no specific width/height is supplied.

@eturpault
Copy link
Contributor Author

Indeed adding another odf type section for this is not justified. I had rather in mind to use the existing label type and when both DispImageNum or Image attributes are empty in the section, to manage it as a single text to display without background, using the attributes provided in that section.

@eturpault
Copy link
Contributor Author

Thanks @oleg68

@eturpault
Copy link
Contributor Author

With GrandOrgue 3.11.0-1 I get the expected result by using DispImageNum=0, thanks !
Label_without_background

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Apr 23, 2023
https://build.opensuse.org/request/show/1082289
by user expeehaa + dimstar_suse
- Update to version 3.11.0.
  Changelog: https://github.com/GrandOrgue/grandorgue/releases/tag/3.11.0-1
  - Added capability of navigating over, loading and saving the YAML combinations files on the Combination Setter panel GrandOrgue/grandorgue#1196
  - Added capability of exporting and importing combinations in yaml format files GrandOrgue/grandorgue#1195
  - Removed support of old linux distros (with libc6 versions before 2.31) GrandOrgue/grandorgue#1334
  - Fixed the translation of the desktop icon on Linux GrandOrgue/grandorgue#1429
  - Added support of labels without a background image by specifying DispImageNum=0 GrandOrgue/grandorgue#1386
  - Added c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants