optimiz3 / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

DirectWrite application implementable interfaces #670

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The DirectWrite interfaces IDWriteFontCollectionLoader, 
IDWriteFontFileEnumerator, IDWriteFontFileLoader, IDWriteFontFileStream, 
IDWriteInlineObject, IDWriteTextAnalysisSink, IDWriteTextAnalysisSource and 
IDWriteTextRenderer are to be implemented be the client 
application. However, currently SlimDX implements these like any other 
DirectWrite interface with the assumption that they all are 
attached to a native COM object, making it impossible to provide custom 
implementations from managed code.

Original issue reported on code.google.com by bjoern.graf@gmail.com on 15 May 2010 at 11:06

GoogleCodeExporter commented 8 years ago

Original comment by josh.petrie on 17 May 2010 at 4:16

GoogleCodeExporter commented 8 years ago
Have you looked at the code on the trunk?  I've tried to make managed 
counterparts 
for these interfaces that are implemented by the client application.  The 
general 
approach has been to create interop classes that marshall back and forth 
between the 
COM interface expected by the API and the .NET interface provided by the 
application.

Original comment by legal...@xmission.com on 17 May 2010 at 8:02

GoogleCodeExporter commented 8 years ago
I’ve been using r1583 (latest of trunk as of this writing). Using [1] as an 
example for custom FontCollectionLoader and 
FontFileEnumerator, e.g. I cannot instantiate my enumerator defined as "class 
Enumerator : FontFileEnumerator" due to the 
lack of a parameterless ctor in FontFileEnumerator. The thing is that these 
ain’t “real” COM objects but only mere 
implementations of IUnknown and the related DirectWrite interfaces.

  [1]: http://msdn.microsoft.com/en-us/library/dd941710(v=VS.85).aspx

Original comment by bjoern.graf@gmail.com on 17 May 2010 at 9:08

GoogleCodeExporter commented 8 years ago
The SlimDX managed interface is IFontCollectionLoader.  Is that what you were 
attempting to implement?

If you look at the ToDo.txt in the source\directwrite folder, it should tell you
what hasn't been implemented yet by me.

I'm slowly working through the Windows 7 SDK DirectWrite samples and trying to
bring them over to SlimDX.

Original comment by legal...@xmission.com on 17 May 2010 at 11:22

GoogleCodeExporter commented 8 years ago
Somehow my custom loader derived form FontCollectionLoader, too and using
IFontCollectionLoader only works indeed. However, I seem to be not able to 
unregister
my loader again: I am catching an "E_INVALIDARG: An invalid parameter was 
passed to the
returning function (-2147024809)" exception for a simple
Factory.RegisterFontCollectionLoader/Factory.UnregisterFontCollectionLoader 
pair.

However, that leaves FontFileEnumerator unimplementable which is required by
IFontCollectionLoader.CreateEnumeratorFromKey().

The ToDo.txt doesn’t seem to mention any of these interfaces.

Original comment by bjoern.graf@gmail.com on 18 May 2010 at 1:45

GoogleCodeExporter commented 8 years ago
Looking to implement a custom TextRenderer in a project. It would be great to 
get the interface done for this (notice it's in ToDo) and complete the 
directwrite sample

Original comment by l...@postcodeanywhere.co.uk on 16 Sep 2010 at 9:25

GoogleCodeExporter commented 8 years ago
Don't think legalize is around anymore. Reassigning.

Original comment by Mike.Popoloski on 17 Jul 2011 at 7:10

GoogleCodeExporter commented 8 years ago
Turns out he is around. Giving back.

Original comment by Mike.Popoloski on 18 Jul 2011 at 1:35

GoogleCodeExporter commented 8 years ago
OK, I didn't get a SlimDX talk accepted for code camp (Sep. 10), so I
will resume work on this after Code Camp unless I have additional time
after preparing my code camp talk.

Original comment by legal...@xmission.com on 17 Aug 2011 at 5:58

GoogleCodeExporter commented 8 years ago
I implemented a bunch of this stuff when doing my DWrite text rendering 
project. There are still a few interfaces left. I'm taking this from legalize 
again, since he never actually came back.

Original comment by Mike.Popoloski on 5 May 2012 at 4:35

GoogleCodeExporter commented 8 years ago
Any plans to fix IDWriteFontFileEnumerator implementation in SlimDX?

Original comment by egwen...@gmail.com on 14 Jan 2015 at 10:02