flat assembler
Message board for the users of flat assembler.
Index
> Windows > DirectWrite Goto page 1, 2 Next |
Author |
|
Overclick 25 Aug 2022, 00:34
Code: .data interface IWriteFactory,\ QueryInterface,\ AddRef,\ Release,\ GetSystemFontCollection,\ CreateCustomFontCollection,\ RegisterFontCollectionLoader,\ UnregisterFontCollectionLoader,\ CreateFontFileReference,\ CreateCustomFontFileReference,\ CreateFontFace,\ CreateRenderingParams,\ CreateMonitorRenderingParams,\ CreateCustomRenderingParams,\ RegisterFontFileLoader,\ UnregisterFontFileLoader,\ CreateTextFormat,\ CreateTypography,\ GetGdiInterop,\ CreateTextLayout,\ CreateGdiCompatibleTextLayout,\ CreateEllipsisTrimmingSign,\ CreateTextAnalyzer,\ CreateNumberSubstitution,\ CreateGlyphRunAnalysis interface IDWriteTextFormat,\ QueryInterface,\ AddRef,\ Release,\ SetTextAlignment,\ SetParagraphAlignment,\ SetWordWrapping,\ SetReadingDirection,\ SetFlowDirection,\ SetIncrementalTabStop,\ SetTrimming,\ SetLineSpacing,\ GetTextAlignment,\ GetParagraphAlignment,\ GetWordWrapping,\ GetReadingDirection,\ GetFlowDirection,\ GetIncrementalTabStop,\ GetTrimming,\ GetLineSpacing,\ GetFontCollection,\ GetFontFamilyNameLength,\ GetFontFamilyName,\ GetFontWeight,\ GetFontStyle,\ GetFontStretch,\ GetFontSize,\ GetLocaleNameLength,\ GetLocaleName IID_IWriteFactory GUID b859ee5a-d838-4b5b-a2e8-1adc7d93db48 DWRITE_FACTORY_TYPE_SHARED = 0 pIWriteFactory IWriteFactory pIDWriteTextFormat IDWriteTextFormat .code ..idata library Dwrite,'Dwrite.dll' ..idata import Dwrite,DWriteCreateFactory,'DWriteCreateFactory' invoke DWriteCreateFactory,DWRITE_FACTORY_TYPE_SHARED,\ IID_IWriteFactory,pIWriteFactory ..data txtFont dw 0x61,0x69,0x72,0x62,0x6d,0x61,0x43,0 ..data txtFamily dw 0x53,0x55,0x2d,0x6e,0x65,0 cominvk pIWriteFactory,CreateTextFormat,txtFont,0,500,0,5,\ float 12.0f,txtFamily,pIDWriteTextFormat E_INVALIDARG Wrong Font and Family or what? |
|||
25 Aug 2022, 00:34 |
|
Roman 25 Aug 2022, 04:16
txtFamily why 6 dw?
O. Its unicode name. Last edited by Roman on 25 Aug 2022, 05:52; edited 1 time in total |
|||
25 Aug 2022, 04:16 |
|
bitRAKE 25 Aug 2022, 05:06
Why are your strings reversed?
You programming from a hex editor these days, lol. Everything else looks fine to me. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
25 Aug 2022, 05:06 |
|
revolution 25 Aug 2022, 05:21
You can also use
Code: du 'Wide chars go here' |
|||
25 Aug 2022, 05:21 |
|
Overclick 25 Aug 2022, 05:58
Still the same error
Code: ..data txtFont du 'Cambria' ..data txtLanguage du 'en-US' cominvk pIWriteFactory,CreateTextFormat,txtFont,0,500,0,5,\ float 12.0f,txtLanguage,pIDWriteTextFormat |
|||
25 Aug 2022, 05:58 |
|
Hrstka 25 Aug 2022, 07:33
You forgot the null character.
Code: ..data txtFont du 'Cambria',0 ..data txtLanguage du 'en-us',0 |
|||
25 Aug 2022, 07:33 |
|
Overclick 25 Aug 2022, 08:36
Quote:
I tried almost everything. Seems it is wrong method or something. |
|||
25 Aug 2022, 08:36 |
|
Roman 25 Aug 2022, 09:21
64 bits ?
On my Windows 10 work this code. Code: ID_IDWriteFactory GUID b859ee5a-d838-4b5b-a2e8-1adc7d93db48 txtFont du 'Arial',0 hpUn du "en-us",0 invoke DWriteCreateFactory,0,ID_IDWriteFactory,DWriteFactory DWRITE_FONT_WEIGHT_NORMAL = 400 DWRITE_FONT_WEIGHT_REGULAR = 400 DWRITE_FONT_STRETCH_NORMAL = 5 DWRITE_FONT_STYLE_NORMAL = 0 cominvk DWriteFactory, CreateTextFormat, txtFont, 0, DWRITE_FONT_WEIGHT_REGULAR, DWRITE_FONT_STYLE_NORMAL,\ DWRITE_FONT_STRETCH_NORMAL,dword 20.0, hpUn, CompsTextFormat2 |
|||
25 Aug 2022, 09:21 |
|
Overclick 25 Aug 2022, 09:43
I changed 'float' to 'dword' in my example and no more error. Why?
|
|||
25 Aug 2022, 09:43 |
|
revolution 25 Aug 2022, 09:53
Float vs dword
Code: dd 12.0, 12 Code: 00 00 40 41, 0c 00 00 00 |
|||
25 Aug 2022, 09:53 |
|
Overclick 25 Aug 2022, 10:01
dword 12.0f
vs float 12.0f |
|||
25 Aug 2022, 10:01 |
|
revolution 25 Aug 2022, 10:07
Does 64-bit code make float into a double?
You can look at the output to see what changes. |
|||
25 Aug 2022, 10:07 |
|
Overclick 25 Aug 2022, 10:21
Quote:
Think so. Have it to be like that? |
|||
25 Aug 2022, 10:21 |
|
revolution 25 Aug 2022, 11:24
Perhaps in fasm, unlike C, float means a variable sized value to match the container.
So if you need a particular size use dword or qword. Problem solved. |
|||
25 Aug 2022, 11:24 |
|
Overclick 25 Aug 2022, 12:39
What is a point to use 'float' then if it's useless?
Why don't Tomasz write 'double' for such reason? |
|||
25 Aug 2022, 12:39 |
|
macomics 25 Aug 2022, 12:42
Or maybe it's better to look at the source text of the cominvk macro without these questions
|
|||
25 Aug 2022, 12:42 |
|
Overclick 25 Aug 2022, 12:54
Where we get documentation from? Microsoft? It developed for cominvk or what? No it's not. Such macro have to cover the real needs and not define some new rules
|
|||
25 Aug 2022, 12:54 |
|
macomics 25 Aug 2022, 13:06
Code: macro cominvk object,proc,[arg] { common assert defined object#.com.object ; must be a COM object macro call dummy \{ mov rax,[rcx] call [rax+object#.#proc] \} fastcall ,[object],arg purge call } next, fastcall Code: macro fastcall proc,[arg] { common local stackspace,argscount,counter ... if counter = 1 if type@param eq float ... else if counter = 2 if type@param eq float ... else if counter = 3 if type@param eq float ... else if counter = 4 if type@param eq float ... end if } |
|||
25 Aug 2022, 13:06 |
|
Overclick 25 Aug 2022, 13:09
Big deal to fix it?
float fix dword float double fix qword float |
|||
25 Aug 2022, 13:09 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.