NoteWorthy Composer Forum

Forums => General Discussion => Topic started by: bersyl91 on 2006-12-31 10:48 am

Title: NWC2 on Linux/Wine
Post by: bersyl91 on 2006-12-31 10:48 am
Godd day all, and all my best wishes for the coming new year!

I'm trying to use NWC2 on my Linux box with the Wine (non-)emulator.

I'm confronted with three curious problems:

- I can perfectly install NWC2, but it's then impossible to upgrade it (error during the copy of nwc2.exe)
- "wings" of notes shorter than quarters are replaced by bizarre vertical rectangles, but only if not beamed
- the "Tab" key is interpreted twice in dialogs (e.g. it skips two fields rather than one).

In fact, the second issue is the most important, because it prevents me from printing the music I compose.

Anybody here having any idea?

Thank you in advance...
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2006-12-31 11:06 am
NWC2 uses the font: NWC2STDA.TTF to render musical symbols.  The flags are the only things that are mapped above 127.  I'd look for something in your configuration that is restricting character codes to 7 bits (0 to 127).  Try to view NWC2STDA with CharMap. The flags should be on the 4th line down.

I know nothing of Linux, but your upgrade problem may a lack of permission to overwrite an executable file.
Title: Re: NWC2 on Linux/Wine
Post by: Richard Woodroffe on 2006-12-31 11:40 am
Matt Johnson has posted some instructions for getting NWC running under the wine emulator in Linux plus a few downloads you might need. This has been posted on the Scriptorium - However it is a while since it was updated (2002) so I don't know how current it is.

http://nwc-scriptorium.org/helpful.html#Wine (http://nwc-scriptorium.org/helpful.html#Wine)

Worth a try though I would think.

Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2006-12-31 12:02 pm
Hi Rick and Rich,

Thank you for your answers.
I've already followed Matt's instructions, but it refers to a fairly old Wine version and on NoteWorthy version 1.
What I'm trying to do is having version 2 working on a recent Wine version and whereas most of what Matt says still applies, I'm confronted with new issues.

For the font characters, I can see chars above 127 (It's fundamental for me as I'm french and use accented chars).
Can it be a problem of hardcoding ? On my Linux box, the flag for a sixteen note with stem down is character "à" (a with a grave accent). Is this encoding ok? I'm afraid the Windows codepage and the ISO 8859-15 encoding don't match exactly...

With charmap, I can see the flags encoded as follows:

8th stem up : Ç (C cedilla)
8th stem down: á (a acute)
16th stem up: É (E acute)
16th stem down: à (a grave)
32th stem up: Ñ (N tilde)
32th stem down: â (a circ)
64th stem up: Ö (O diaeresis)
64th stem down: ä (a diaeresis)

(Well, they're not all on the 4th line down but it's certainly a problem of screen resolution: I can only have 14 characters on one line)

Concerning the permissions, I own the integrality of files in my wine environment. I'll try this as root, it can be an idea, thanks.
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2006-12-31 12:45 pm
On my Linux box, the flag for a sixteen note with stem down is character "à" (a with a grave accent). Is this encoding ok? I'm afraid the Windows codepage and the ISO 8859-15 encoding don't match exactly...
No, that is not right. NWC2STDA is a symbol font and you are not getting symbol font mapping.

Quote from: my font editor (Softy) documentation
When assigning codes for the Microsoft map, these should be Unicode values. Windows remaps these when the font is installed. For Symbol fonts, which should have codes starting at 0xf020, Windows assumes that the first character corresponds to a space (code 0x20, decimal 32), then that the next 223 character codes map to (decimal) 33-255. 0xf000 is added to the input value when a glyph is mapped to a character in this context. For UGL character sets, the following mappings are made to produce the Windows ANSI character set where the Unicode value is not the same as the Windows character set value.

Mapped to   From
130 (0x82)   8218   (0x201A)   8th upflag
131 (0x83)     402   (0x0192)  16th upflag
132 (0x84)   8222   (0x201E)  32nd upflag
133 (0x85)   8230   (0x2026)  64th upflag
134 (0x86)   8224   (0x2020)
135 (0x87)   8225   (0x2021)   8th downflag
136 (0x88)     710   (0x02C6)  16th downflag
137 (0x89)   8240   (0x2030)  32nd downflag
138 (0x8A)     352   (0x0160)  64th  downflag
I don't know if any of that will help.
Worst case, you may need a custom version of the font.
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-02 02:26 pm
No, that is not right. NWC2STDA is a symbol font and you are not getting symbol font mapping.
I don't know if any of that will help.
Worst case, you may need a custom version of the font.

Well, I don't know what you mean with "symbol" font. All I know is that a font is a map of characters into a certain encoding. Perhaps I don't have to make a parallel with alphabetic chars, but I think it's not that important.

Your idea may not be bad: making a custom font may be a good idea. It seems that there is no common place between the encoding I get and the one which exists on Windows. So I can perhaps enrich the font with a copy of the flags at the right place for ISO-8859 encoding...

Thank you for the detailed map, I'll try this, I think.
Title: Re: NWC2 on Linux/Wine
Post by: kahman on 2007-01-02 09:32 pm
Well, I don't know what you mean with "symbol" font.
What he means is that instead of "a" coming out as "a", "a" comes out as a treble clef.

For a full list of everything, download one of Lawrie Pardy's fonts and look at the documentation.
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2007-01-03 01:26 am
What he means is that instead of "a" coming out as "a", "a" comes out as a treble clef.
No, that is not what I mean. Windows fonts have bits set in their headers to describe how to "map" a character to a glyph. Search for "symbol" on the following page to read Microsoft's terse decription:
http://www.microsoft.com/typography/OTSPEC/cmap.htm (http://www.microsoft.com/typography/OTSPEC/cmap.htm)

Marlett, Wingdings and Webdings are all Windows symbol fonts.

If you google "wine" and any of the above, you will get a list of user problems with them.  
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-03 10:42 am
Thanks to all, I've crated an Bugzilla entry on WineHQ: http://bugs.winehq.org/show_bug.cgi?id=7040

I'll investigate further...
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-04 08:03 pm
Well, on WineHQ, someone asked me an excellent question: Does the bug appear with version 1.75 ?

So I installed V1.75b and tried, and the flags appear perfectly.

Does someone have an explanation? a turnaround? something?
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-04 09:07 pm
NWC 1.75 does not use a Symbol font for notation. It also uses a significantly different scheme for displaying notation glyphs.
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-04 09:22 pm
By the way, the NWC Viewer (http://ntworthy.com/nwc2/viewer.htm) also uses the same NWC2 symbol font, and can be freely acquired from our site (uploading it to another site is not permitted by its license).

You might also want to try creating a metafile snapshot, and then viewing it with our viewer to see if the EMF render of the font looks any better than what is seen inside NWC2:

NoteWorthy Software's Enhanced Metafile Viewer
http://ntworthy.com/nwc2/nwemfviewer.htm
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2007-01-05 01:16 am
NWC 1.75 does not use a Symbol font for notation.
Sure it does. What is does not do is use 8bit characters. The range from 0x80 to 0x9f is a particular problem as Windows treats these differently from every other OS in the galaxy.
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-05 04:43 am
Just to repeat: The NWC 1.75 notation font, NWCV15, is not a Symbol font.

As a matter of trivia, the early development of NWC2 also did not use a Symbol font. The NWC2 notation font was changed to a symbol font with the release of NWC2 Private Preview 2 on 2002-10-25. Official NWC2 testers can read the announcement here (https://forum.noteworthycomposer.com/?topic=2653.msg15234#msg15234). This change revealed a metafile problem with Symbol fonts in OpenOffice (http://www.openoffice.org/issues/show_bug.cgi?id=9196) (see also, Copying notes from the editor (https://forum.noteworthycomposer.com/?topic=2774.0)). We privately released a utility, WMFixup, which could change the NWC2 font mapping in a WMF file, so it would be rendered correctly by OpenOffice. The final resolution of this issue in OpenOffice was announced here (https://forum.noteworthycomposer.com/?topic=3294.0).
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2007-01-05 10:26 am
NWCV15, is not a Symbol font.
Microsoft TrueType CmapEditor Version 0.60 (Feb 14 2002)
reports this:

[subtable2]
platformID = 3
encodingID = 0
format = 4
version = 0
0x0020, 59
0x002C, 42
0x002D, 43
  •  •  •
0x0077, 29
0x0078, 25
0x0079, 27
0x007A, 22

Quote
www.microsoft.com/typography/OTSPEC/cmap.htm (http://www.microsoft.com/typography/OTSPEC/cmap.htm)
When building a symbol font for Windows, the platform ID should be 3 and the encoding ID should be 0.
So, the actual encoding is not symbol, but the encoding ID is symbol. I was hasty in calling it a symbol font.
Since it doesn't encode anything below 0x20 or above 0x7E, it probably doesn't matter.

BTW, the two topics you reference (2774.0 and 3294.0) lead to a page that says:
An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you.

Title: Re: NWC2 on Linux/Wine
Post by: kahman on 2007-01-05 12:22 pm
BTW, the two topics you reference (2774.0 and 3294.0) lead to a page that says:
An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you.


That's because you're not an official NWC2 Tester, see https://forum.noteworthycomposer.com/?topic=5483.0 (https://forum.noteworthycomposer.com/?topic=5483.0)
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-05 12:33 pm
SMF doesn't return a very useful response for permission issues. We'll try to improve this.
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2007-01-05 01:03 pm
That's because you're not an official NWC2 Tester, see https://forum.noteworthycomposer.com/?topic=5483.0 (https://forum.noteworthycomposer.com/?topic=5483.0)
Possibly ...   
 I'm still holding out for Certified Hack ... (https://forum.noteworthycomposer.com/?topic=5483.msg35560#msg35560)

Back to the topic at hand. The best solution for this might be for NoteWorthy to change ncw2stda.ttf and the way it uses it. Currently, replacement fonts are few (Lawrie Pardy and I have some). Everything in ncw2stda.ttf will fit in the range from 0x20 - 0x7E.

NoteWorthy Composer is an inexpensive program. It is not memory or resource hungry. (It will still run on a 486 with Win95, I think) It is a natural fit for Windows emulators running on non-Windows platforms. NWC2 might do well to make this as easy as possible.

When the time comes that more character slots are needed, the emulators may have reached a consensus on a font standard.
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-05 01:22 pm
Ok, I think I've understood grosso modo what you speak about concerning symbol fonts.
But I don't understand really how I can have NWC2 work under Wine/Linux?
The problem may be very simple an resolved with a duplication of the glyphs at the places Wine tries to find them, no?

The problem is, I don't now anything about creating TTF fonts, nor can I figure out WHERE NWC2 hits the font map in thos cases.
Does someone know enough to build a test font that I may try?
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-06 12:28 am
We will try to look into this further.

I have started the process of analyzing this problem. If there is a simple change in NWC2 that we can make to resolve this problem, we will do so.

Technical info:
Quote
The problem most likely starts somewhere in here:

BOOL WINAPI ExtTextOutA
http://source.winehq.org/source/dlls/gdi32/font.c#L1675

Assuming the latest WINE mostly handles Symbol fonts properly, the most probable place of problems is the IsDBCSLeadByte logic, which disregards the character "count" when doing its calculations:

BOOL WINAPI IsDBCSLeadByte
http://source.winehq.org/source/dlls/kernel32/locale.c#L1545

I'll try to get a current edition of WINE running here in the lab in the next few days to see what can be done.
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-06 01:00 am
Thanks very much.

If I can be of any help (essentialy on Linux, I think), please don't hesitate to contact me.
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-06 01:57 am
Thanks for the offer. Can you try the latest NWC Viewer? It is available at:

NoteWorthy Composer Viewer
http://ntworthy.com/nwc2/viewer.htm

If Wine handles Symbol encoding properly (other than its failure to respect the character count mentioned in my previous reply), then this new release of the Viewer should work better.
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-06 03:03 am
A friend of mine just made the test. He gets the same result.

Do you want me to do some more tests with the viewer?
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-06 03:06 am
Here is a sample of what I get.
http://bugs.winehq.org/attachment.cgi?id=4508&action=view

The left screenshot is got with Windows and the right one with Wine.
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-06 07:32 am
The screen shot was taken before the release of the latest NWC Viewer (Beta 2.11), but the comment about the win32 font viewer program probably confirms a more serious Wine problem.

Old links about this problem:
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-06 08:08 pm
We have the latest NWC Viewer (Beta 2.11) running with Wine (wine-0.9.28) on Ubuntu 6.10. We get the same results with regard to the NWC2 font. I do not have anything more to report at this time.
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-06 08:33 pm
Update: I used NWC2 to create a *.emf file in Windows XP. In Ubuntu, I opened the emf file with the Enhanced Metafile Viewer (http://ntworthy.com/nwc2/nwemfviewer.htm) using Wine. It displayed all of the NWC2 notation symbols correctly. Therefore, Wine is capable of properly rendering Symbol fonts when rendering Enhanced Metafiles. Perhaps it has problems with the handling of the Symbol font when given ANSI strings.
Title: Re: NWC2 on Linux/Wine
Post by: kahman on 2007-01-06 10:07 pm
I'm not sure about how emf files are created.  If an emf file actually uses the font, that's a completely different matter then if it's just like a jpeg.

If emf is just a bunch of pixels like a jpeg, of course it would render correctly.  You say that it has problems when given ANSI strings, which are far from a bitmap.

What happens if you create an emf file in Ubuntu and view it in Windows XP?
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-06 10:09 pm
When created by NWC2, *.emf files contain vector graphics and font data.
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2007-01-07 01:30 am
http://www.math.uiuc.edu/~hartke/computer/exp/exp.php (http://www.math.uiuc.edu/~hartke/computer/exp/exp.php) has the most detailed description of one users fix
I tried it and it won't work. NWC2 refuses to use an ANSI encoded font as its System Font. Too bad.

I did discover that system fonts are not restricted to those identified as NWC2*
That is just a filter to populate the dropdown .  You can type in: marlett
But if you type in: arial, nothing changes.
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-07 12:21 pm
Any NWC2 notation font has to be encoded as a Symbol font.
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-07 02:25 pm
OK. The bug in Wine is basically what Rick G identified in his first reply. Wine uses the wrong code page in its Symbol encoded ANSI string conversion. The exact bug is (apparently) contained in this function:

static LPWSTR FONT_mbtowc
http://source.winehq.org/source/dlls/gdi32/font.c#L352

I suspect that this function should really include the device context in its processing. If the currently selected font is Symbol encoded, then this function should use the CP_SYMBOL code page (42) in its call to MultiByteToWideChar.

It looks like we might add a work around for this within NWC2. We have a working patch here in the lab, but I have not yet authorized it for inclusion in NWC2 Beta cycle. I will schedule some extensive regression testing on the patch...
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-08 01:57 pm
I have posted a fix to your Bugzilla report.

The changes necessary to fix Wine's "font.c" text handling are shown below:

Code: [Select · Download]
352c352
< static LPWSTR FONT_mbtowc(LPCSTR str, INT count, INT *plenW)
---
> static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW)
354c354
<     UINT cp = CP_ACP;
---
>     UINT cp = (GetTextCharset(hdc) == SYMBOL_CHARSET) ? CP_SYMBOL : CP_ACP;
1025c1025
<     LPWSTR p = FONT_mbtowc(str, count, &wlen);
---
>     LPWSTR p = FONT_mbtowc(hdc, str, count, &wlen);
1134c1134
<     p = FONT_mbtowc(str, count, &wlen);
---
>     p = FONT_mbtowc(hdc, str, count, &wlen);
1651c1651
<     wstr = FONT_mbtowc(str, count, &wlen);
---
>     wstr = FONT_mbtowc(hdc, str, count, &wlen);
1686c1686
<     p = FONT_mbtowc(str, count, &wlen);
---
>     p = FONT_mbtowc(hdc, str, count, &wlen);
2298c2298
<     wstr = FONT_mbtowc(str, count, &wlen);
---
>     wstr = FONT_mbtowc(hdc, str, count, &wlen);
2436c2436
<         p = FONT_mbtowc(mbchs, len, NULL);
---
>         p = FONT_mbtowc(hdc, mbchs, len, NULL);
2742c2742
<     lpstrW = FONT_mbtowc(lpstr, count, &countW);
---
>     lpstrW = FONT_mbtowc(hdc, lpstr, count, &countW);
2794c2794
<     lpStringW = FONT_mbtowc(lpString, uCount, &uCountW);
---
>     lpStringW = FONT_mbtowc(hdc, lpString, uCount, &uCountW);
2934c2934
<     wstr = FONT_mbtowc(str, count, &wlen);
---
>     wstr = FONT_mbtowc(hdc, str, count, &wlen);
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2007-01-08 08:24 pm
I have posted a fix to your Bugzilla report.
I hope Wine users appreciate the time that fix took. If they implement it, it will probably fix the problem for every music notation program.

But why does NWC2 treat the Notation font differently from say, User 1 or Staff Bold?
An issue for a new thread ...
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-08 10:51 pm
Thank you very much, admin.

To make sure, I've posted your patch to wine-patches@winehq.org but I suppose you've already done that.

Okay, let's concentrate on the other issues (the tab key one, for example...)
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-08 10:56 pm
Oops! I realize that I've not described this issue here.

Under Wine, when I use the tab key to navigate between fields, the cursors moves _two_ fields away instead of one.
If I use shift-tab, the same occurs (to fields before instead of one).

Very strange, no?
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-08 11:18 pm
Wine had lots of trouble with NWC's tabbed dialog boxes (which are modeless, but with special hooks to make them modal). I suspect that you won't see much improvement on that front any time soon.
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-08 11:30 pm
Oh! What a pity. Okay, it's not blocking for now.

Another problem I have is that it's impossible to me to run the upgrade installers. The copy fails on nwc2.exe.

I've opened the bug 7046 on http://bugs.winehq.org/show_bug.cgi?id=7046 for that, but I'm a bit clueless...
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-09 08:47 am
Well, at wine-hq, they want a diff -u, but I can't create it for them...

Date: Tue, 9 Jan 2007 06:18:27 +0100
From: Marcus Meissner <meissner@suse.de>
To: wine-devel@winehq.org, me@me.org
Subject: Re: Proposed patch for "fonts.c"

(...)

> 352c352
> < static LPWSTR FONT_mbtowc(LPCSTR str, INT count, INT *plenW)
> ---
> > static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW)

Please use "diff -u".

Ciao, Marcus
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-09 02:46 pm
Regarding the NWC2 installer/updater on Wine, I added the following to your Wine report:

Quote
The NWC2 install programs use NSIS CopyFiles instruction with the /SILENT directive, which calls the Windows Shell function SHFileOperation with the operation set to FO_COPY. In Windows, this operation can be used to replace an existing file. In Wine, this operation will fail when the target file exists.

The exact cause can be found here:

http://source.winehq.org/source/dlls/shell32/shlfileop.c#L1075

Code: [Select · Download]
if (SHNotifyCopyFileW(entryToCopy->szFullPath, fileDest->szFullPath, TRUE))

By setting the parameter "bFailIfExists" to true, the file copy operation will fail when the target file exists.

The "diff -u" for font.c is as follows (we will e-mail it to the Wine folks):

Code: [Select · Download]
--- orig-font.c	Mon Jan  8 07:27:52 2007
+++ font.c Mon Jan  8 07:30:55 2007
@@ -349,9 +349,9 @@
  * the number of WCHARs that have been written.  The caller should free
  * the returned LPWSTR from the process heap itself.
  */
-static LPWSTR FONT_mbtowc(LPCSTR str, INT count, INT *plenW)
+static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW)
 {
-    UINT cp = CP_ACP;
+    UINT cp = (GetTextCharset(hdc) == SYMBOL_CHARSET) ? CP_SYMBOL : CP_ACP;
     INT lenW;
     LPWSTR strW;
 
@@ -1022,7 +1022,7 @@
 {
     BOOL ret = FALSE;
     INT wlen;
-    LPWSTR p = FONT_mbtowc(str, count, &wlen);
+    LPWSTR p = FONT_mbtowc(hdc, str, count, &wlen);
 
     if (p) {
  ret = GetTextExtentPoint32W( hdc, p, wlen, size );
@@ -1131,7 +1131,7 @@
        NULL == (walpDx = HeapAlloc(GetProcessHeap(), 0, count * sizeof(INT))))
        return FALSE;
     
-    p = FONT_mbtowc(str, count, &wlen);
+    p = FONT_mbtowc(hdc, str, count, &wlen);
     ret = GetTextExtentExPointW( hdc, p, wlen, maxExt, lpnFit, walpDx, size);
     if (walpDx)
     {
@@ -1648,7 +1648,7 @@
     for(i = 0; i < count; i++)
  str[i] = (BYTE)(firstChar + i);
 
-    wstr = FONT_mbtowc(str, count, &wlen);
+    wstr = FONT_mbtowc(hdc, str, count, &wlen);
 
     for(i = 0; i < wlen; i++)
     {
@@ -1683,7 +1683,7 @@
     if (flags & ETO_GLYPH_INDEX)
         return ExtTextOutW( hdc, x, y, flags, lprect, (LPCWSTR)str, count, lpDx );
 
-    p = FONT_mbtowc(str, count, &wlen);
+    p = FONT_mbtowc(hdc, str, count, &wlen);
 
     if (lpDx) {
         unsigned int i = 0, j = 0;
@@ -2295,7 +2295,7 @@
     for(i = 0; i < count; i++)
  str[i] = (BYTE)(firstChar + i);
 
-    wstr = FONT_mbtowc(str, count, &wlen);
+    wstr = FONT_mbtowc(hdc, str, count, &wlen);
 
     for(i = 0; i < wlen; i++)
     {
@@ -2433,7 +2433,7 @@
             len = 1;
             mbchs[0] = (uChar & 0xff);
         }
-        p = FONT_mbtowc(mbchs, len, NULL);
+        p = FONT_mbtowc(hdc, mbchs, len, NULL);
  c = p[0];
     } else
         c = uChar;
@@ -2739,7 +2739,7 @@
     TRACE("(%p, %s, %d, %p, 0x%x)\n",
           hdc, debugstr_an(lpstr, count), count, pgi, flags);
 
-    lpstrW = FONT_mbtowc(lpstr, count, &countW);
+    lpstrW = FONT_mbtowc(hdc, lpstr, count, &countW);
     ret = GetGlyphIndicesW(hdc, lpstrW, countW, pgi, flags);
     HeapFree(GetProcessHeap(), 0, lpstrW);
 
@@ -2791,7 +2791,7 @@
     /* both structs are equal in size */
     memcpy(&resultsW, lpResults, sizeof(resultsW));
 
-    lpStringW = FONT_mbtowc(lpString, uCount, &uCountW);
+    lpStringW = FONT_mbtowc(hdc, lpString, uCount, &uCountW);
     if(lpResults->lpOutString)
         resultsW.lpOutString = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*uCountW);
 
@@ -2931,7 +2931,7 @@
     for(i = 0; i < count; i++)
         str[i] = (BYTE)(first + i);
 
-    wstr = FONT_mbtowc(str, count, &wlen);
+    wstr = FONT_mbtowc(hdc, str, count, &wlen);
 
     for (i = 0; i < wlen; i++)
     {
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-09 11:51 pm
Okay, perfect, thank you.

Do you want me to do something on this?
Title: Re: NWC2 on Linux/Wine
Post by: Steele on 2007-01-13 10:04 am
I'm really looking forward to this NWC2 / WINE thing.
What holds me away from using Linux is actually the NWC and GigaStudio.
But I've seen, there is a Linux sampler project which makes *gig Files Avaible. With the NWC2 in WINE it would be really nice.

Thanks for all your work and keep on :)
Title: NWC2 Beta 2.12 on Linux/Wine
Post by: NoteWorthy Online on 2007-01-13 03:29 pm
Although we do not officially support Wine, NWC2 Beta 2.12 does include several changes that should help your situation.



Beta 2.12 is available now.
Title: Re: NWC2 on Linux/Wine
Post by: kahman on 2007-01-13 03:54 pm
Good.  This means that if bersyl91 says it works fine, I might actually be able to switch to Linux if I wanted to.  This would also open up NWC2 to the Mac OS X crowd.

Now, if only we could go through a Wizard like the NWC2 Enrollment Wizard to download an installer package... ;-)
Title: Re: NWC2 on Linux/Wine
Post by: Steele on 2007-01-13 07:34 pm
Thank you NoteWorthyComposer Team. i'm not at home till march but i'm looking forward to try NWC2 in Linux.

Eventhough it's not official (which, I think, means 'no support') I think this really helps for the popularity of NWC2 which is a tool I prefer because of it's low cost and its handyness.


Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-01-14 01:08 am
This means that if bersyl91 says it works fine, I might actually be able to switch to Linux if I wanted to.

Well, what a responsibility! I don't know if I'm that important...

I want to thank very much the development team for it's reactivity, I'm really impressed.

And YES! I now *can* write eigths with their flags visible *and* proceed to the update.
Of course, it'll be better if Wine's bugs are fixed, but many thanks again for the workarounds.

That said, I have to mention that I haven't tested the MIDI output nor any and all NWC2's funcionnalities under Wine. So I can't assert for sure that what I think sufficient for me is enough for others. Your mileage may vary.

It's enough to build, edit and print scores of 25 pages for SATB, organ and gong (this is what I just did).

..and now, I go to bed, because here, it's 2:00AM ;-))
Title: Re: NWC2 on Linux/Wine
Post by: Steele on 2007-03-11 11:46 am
Just a little Report.
I switched to Ubuntu 6.10 and trying to use it as a musicians/composers System. For me, the workspace and feeling is very important for composing. I very much like the linux and open source spirit and I always wanted to switch.

Now its done.
NWC2 with WINE works fast and with no complaining. But I have difficulties with my Midi Output, with Ubuntu in generally.
I thought I was pretty good with all these sequencer, sampler and midi stuff, but now it turns out that linux is a bit more complex (in positive as in negative meaning) with Midi and Audio. All these JACK and ALSA and OSS and you have to keep watch what is running because they are blocking each other...

However: I didn't heard a note out of NWC2 in Wine. That doesn't mean, it has anything to do with NWC, I think its more WINE and this ALSA/JACK thing, because I'm running JACK for my sampler and I dont think WINE has JACK Support. But I dont know if this counts for midi.. I see all the Midi-Ports (inclusive of JACK and the own Sampler Port) in NWC and its playing, but there is just no output.

Generally it works. I connected my Midi Masterkeyboard to my M-Audio Audiophile 2469 and can use NWC to grab the Input (only plain input tested, no recording). Second I can use this Master Keyboard to connect to the Sampler (in JACK) and I can hear the Soundfonts.
All in all, it looks like a softwareconnection problem. I'll see how it turns out.

All in all I just want to use NWC. I don't like the WYSIWYG Editors in whole paper-format, I like the scrolling and the complete partiture-layout without breaks as we all know it. I don't know any other program which is similar to NWC, especially in Linux. Since I have still WindowsXP Notebook I will continue to use NWC.  But WINE is WINE... its not an emulator, but It's still an additional layer with additional problems :(

Why don't you go Open Source or make at least a linux version, Noteworthys? :)

Nils, sharing his experience
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2007-03-11 08:26 pm
+1
I've got the same problem on Debian, without JACK but I never heard a note too :-(
Title: Re: NWC2 on Linux/Wine
Post by: Steele on 2007-03-11 10:52 pm
I've done it!
What I've forgot (I didn't know it and all the time I only thought about Noteworthy itself) is that WINE itself is capable of JACK.

Here is my setup:

Ubuntu 6.10 (Edgy) comes with ALSA. (that is not so important)
then JACK trough QT Jack Control Interface.
Fluidsynth through Qsynth with a random GM-Soundfont (SF2) from Hammersound.net (.com?)
then you need libjack, I used synaptics package manager for libjack0.100.0-0 and libjack0.100.0-0-dev
WINE has to be a pretty new version, I have 0.932 . With the package from ubuntu 6.10 you will get JACK Errors.
NWC2, a version after the WINE Patches (.9 or .11 ?)

now, in terminal, run winecfg and go to the audio-tab. You should get no warnings or errors, specially none about JACK.
deactive all drivers, because probably ALSA or OSS is already activated, and then active JACK and everything concerning JACK.

close the config-dialog and then launch NWC. In the Midi menu choose the fluidsynth directly. Maybe it will be a bit slow at first and take some time, but I will go on.
Then play. If you don't hear anything be sure that in your JACK Connections Fluidsynt is connected to your PCM output.


My next step is to run the Linux Sampler Project instead of Fluidsynth. I think that would'nt be a big problem. Then I have support for die *.gig Sample Format.
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2008-06-19 08:02 am

Good day,

Wine had lots of trouble with NWC's tabbed dialog boxes (which are modeless, but with special hooks to make them modal). I suspect that you won't see much improvement on that front any time soon.

I'm back with this (old) issue because there are news: The 1.0 version of Wine is out and I'm asked wether the bug still exists.

I've tried some softs around but I couldn't reproduce the bug with any of them apart NWC2.
Even there, it's not pretty clear.

For example, in the File/Open or File/Info dialog boxes, the Tab key functions perfectly, but under Staff Properties, Tools/Options or File/Page Setup, the bug appears.

I wonder if there isn't something peculiar in those dialogs?
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2008-06-19 08:07 am

The Wine Team asks me for a downloadable version of the software but for license reasons, I can't give them.
Can someone help us in this matter?

The bugzilla site of our discussion is there:
http://bugs.winehq.org/show_bug.cgi?id=11056
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2008-06-19 11:12 am
The NWC tabbed dialogs are significantly different (and more complex) than the standard Windows modal dialog of File, Info. Internally, they are not modal windows like conventional dialog boxes, and the tab key navigation is implemented internally by NWC using SetWindowsHookEx(WH_KEYBOARD, ...).

The NWC Evaluation program uses the same technique for its tabbed dialogs.

NoteWorthy Composer - Download Evaluation
http://ntworthy.com/composer/evaluate.htm
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2008-06-19 12:16 pm
the tab key navigation is implemented internally by NWC using SetWindowsHookEx(WH_KEYBOARD, ...).
That may explain why they are so hard to drive with SendKeys. Fortunately, if you set up the registry, you can get them to popup with the needed Tabbed page on top. From there, XP and '98 need different techniques. I had to send an initial {Tab} in '98 to get to the same to the state as XP.

This is better left for the 'User Tools' board. I only mention it here as it might bear on the problem.
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2008-06-22 06:36 pm
In addition to the «Tab» key problem (or not?) I've noticed that the «Del» key seems to be counted twice, too.
When I use it, I get:
1) the current note deleted
2) the dot (for dotted notes) selected.

Perhaps also a problem with the «numLock» key?
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2008-06-22 06:41 pm
Another problem for this evening (And after that, I go to bed, I promise;-))

In certain circumstances, the Preview hangs and kills the entire application.

I've noted:

1) The preview mode is pre-calibrated to a certain size (which annoys me because I own a big monitor and I always have to enlarge the preview, but that's another question);
2) When the problem arrives, it seems that the preview begins in full screen (but only the top of the window is displayed);
3) Certain pieces always hangs (the Carmen sample, for example);
4) It's more likely to hang if I've modified important things like margins, number of staves, etc.
5) It hangs under the viewer too.
Title: Re: NWC2 on Linux/Wine
Post by: bersyl91 on 2008-06-22 06:43 pm
Well, I can't resist to give you some stuff again;-)

In trying to update my NWC2, I get the following message:

Impossible d'exécuter la commande spécifiée. Le fichier ou le dossier file:///home/bernard/.wine/drive_c/Program Files/NoteWorthy Composer 2/栢瑴獰⼺眯睷渮瑯睥牯桴獹景睴牡⹥潣⽭睮㉣瀮灨欿祥戽瑥㉡ㅸⰸⰰ〲㠰㘰㈲㌬䍨捶湶䠴坱䩙歉䉬煄䝴≯Ⱜㄭ〬ⰬⰬ n'existe pas.

Nice characters, aren't they?

Good evening, it's time to bed for me here ;-)
Title: Re: NWC2 on Linux/Wine
Post by: Christian Carlsson on 2008-08-17 06:15 pm
I have successfully used NWC2 on Linux/Wine for about two years. The program still works well, but the Access NoteWorthy Software.com functionality was lost some version updates ago, and now updating NWC2 is more difficult than it used to be. It seems I have to do it by logging into Windows (my machine has dual boot). Before I could update directly under Linux/Wine.

Has anybody else experienced the same?

--Christian
Title: Re: NWC2 on Linux/Wine
Post by: Rick G. on 2008-08-17 06:50 pm
I have successfully used NWC2 on Linux/Wine for about two years.
Just curious:
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2008-08-18 12:50 am
the Access NoteWorthy Software.com functionality was lost some version updates ago

The nature of this function (sending a URL to the Windows shell) has remain unchanged since it was first introduced. The actual URL that is used has changed, but the mechanics of passing the URL to the system has not.

Perhaps the change from "http" to "https" in the URL now causes the mechanism to fail on your installation. This also happens to some Windows users when they do not have a proper shell association between https://... links and a browser.

The trick is to have a working association between https://... links and a browser. I am not sure how Wine handles this. I look around and see what I can find.
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2008-08-18 12:54 am
Apparently, Wine uses the Windows registry, just like Windows. You might want to check this registry key:

HKEY_CLASSES_ROOT\https\shell\open\command
Title: Re: NWC2 on Linux/Wine
Post by: Christian Carlsson on 2008-08-18 09:03 am
Quote
Do User Tools work?
I do not regularly use use User Tools, so my experience is limited. My feeling is that they work OK.

Quote
Are you able to use SoundFonts (*.sf2) files with your soundcard?
I use Timidity (soft synth) with various sound fonts, and I am happy with the results.

Quote
Apparently, Wine uses the Windows registry, just like Windows. You might want to check this registry key:
HKEY_CLASSES_ROOT\https\shell\open\command
Many thanks for this, it solved the problem! I changed the key to "firefox".
I still get this non-critical error report: "First try failed, probably due to a system setup problem with your default browser. Now trying a different approach...", after which Firefox opens the Access NoteWorthy page correctly.

--Christian
Title: Re: NWC2 on Linux/Wine
Post by: NoteWorthy Online on 2008-08-18 12:59 pm
The error might be caused by the "ddeexec" portion of the "open" command. You might want to try simply removing the "ddeexec" section if it exists. You could also look at how the "http" section is handled (since it apparently works for you), and make the "https" section look similar.
Title: Re: NWC2 on Linux/Wine
Post by: Christian Carlsson on 2008-08-22 07:17 am
Just curious:
  • Are you able to use SoundFonts (*.sf2) files with your soundcard?

Rick,
It should be as simple as installing the package "awesfx" and doing "sfxload file.sf2" at the command line, this should work with my SBLive soundcard. I am going to experiment with this next week upon return from a few days of sailing in the archipelago. Thanks for bringing up this question, it may open up a new dimension for me.

--Christian
Title: Re: NWC2 on Linux/Wine
Post by: Christian Carlsson on 2008-08-25 03:50 pm
Just curious:
  • Do User Tools work?
  • Are you able to use SoundFonts (*.sf2) files with your soundcard?

Rick,

I can now confirm that I can use SoundFonts with my SBLive soundcard under Linux/Wine/NWC. Installation is straightforward and painless. I am grateful for you pointing me in this direction.

--Christian
Title: Re: NWC2 on Linux/Wine
Post by: yukulele on 2019-04-10 07:11 am
I just fond a workaround for tab twist issue:
Press tab focus on next field twice: one time on key-down, one time on key-up.

Workaround:
- press TAB
- press ALT
- release TAB
- release ALT