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

UWP build error when building ttf loader #1912

Closed
Tracked by #2067
rinechran opened this issue Jan 16, 2024 · 4 comments
Closed
Tracked by #2067

UWP build error when building ttf loader #1912

rinechran opened this issue Jan 16, 2024 · 4 comments
Assignees
Labels
portability Portability Issues among the machines
Milestone

Comments

@rinechran
Copy link
Member

The CreateFileA/GetFileSize function is not available in uwp, resulting in an error.

Error while working on vcpkg.

microsoft/vcpkg#36179
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfile2

"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe" "-Isrc\thorvg-0.dll.p" "-Isrc" "-I..\src\v0.12.1-747f5d510c.clean\src" "-Iinc" "-I..\src\v0.12.1-747f5d510c.clean\inc" "-I." "-I..\src\v0.12.1-747f5d510c.clean" "-Isrc\bindings\capi" "-I..\src\v0.12.1-747f5d510c.clean\src\bindings\capi" "-Isrc\renderer" "-I..\src\v0.12.1-747f5d510c.clean\src\renderer" "-Isrc\renderer\sw_engine" "-I..\src\v0.12.1-747f5d510c.clean\src\renderer\sw_engine" "-Isrc\common" "-I..\src\v0.12.1-747f5d510c.clean\src\common" "-Isrc\loaders" "-I..\src\v0.12.1-747f5d510c.clean\src\loaders" "-Isrc\loaders\tvg" "-I..\src\v0.12.1-747f5d510c.clean\src\loaders\tvg" "-Isrc\loaders\svg" "-I..\src\v0.12.1-747f5d510c.clean\src\loaders\svg" "-Isrc\loaders\ttf" "-I..\src\v0.12.1-747f5d510c.clean\src\loaders\ttf" "-Isrc\loaders\lottie" "-I..\src\v0.12.1-747f5d510c.clean\src\loaders\lottie" "-Isrc\loaders\png" "-I..\src\v0.12.1-747f5d510c.clean\src\loaders\png" "-Isrc\loaders\jpg" "-I..\src\v0.12.1-747f5d510c.clean\src\loaders\jpg" "-Isrc\loaders\raw" "-I..\src\v0.12.1-747f5d510c.clean\src\loaders\raw" "-Isrc\savers" "-I..\src\v0.12.1-747f5d510c.clean\src\savers" "-Isrc\savers\tvg" "-I..\src\v0.12.1-747f5d510c.clean\src\savers\tvg" "-ID:/installed/x64-uwp/include" "/MDd" "/nologo" "/showIncludes" "/utf-8" "/W2" "/EHsc" "/std:c++14" "/permissive-" "/O1" "/Gw" "/Zi" "-DEXAMPLE_DIR=\"D:/b/thorvg/src/v0.12.1-747f5d510c.clean/src/examples/resources\"" "-DTEST_DIR=\"D:/b/thorvg/src/v0.12.1-747f5d510c.clean/test/resources\"" "-DWIN32" "-D_WINDOWS" "-D_UNICODE" "-DUNICODE" "-DWINAPI_FAMILY=WINAPI_FAMILY_APP" "-D__WRL_NO_DEFAULT_LIB__" "-nologo" "-Z7" "-MP" "-GS" "-Gd" "-Gm-" "-W3" "-WX-" "-Zc:wchar_t" "-Zc:inline" "-Zc:forScope" "-fp:precise" "-Oy-" "-EHsc" "-utf-8" "-ZW:nostdlib" "-D_DEBUG" "-MDd" "-Od" "-RTC1" "-DTVG_EXPORT" "-DTVG_BUILD" "/Fdsrc\thorvg-0.dll.p\loaders_ttf_tvgTtfLoader.cpp.pdb" /Fosrc/thorvg-0.dll.p/loaders_ttf_tvgTtfLoader.cpp.obj "/c" ../src/v0.12.1-747f5d510c.clean/src/loaders/ttf/tvgTtfLoader.cpp
cl : Command line warning D9025 : overriding '/Zi' with '/Z7'
cl : Command line warning D9025 : overriding '/W2' with '/W3'
cl : Command line warning D9025 : overriding '/O1' with '/Od'
../src/v0.12.1-747f5d510c.clean/src/loaders/ttf/tvgTtfLoader.cpp(45): error C3861: 'CreateFileA': identifier not found
../src/v0.12.1-747f5d510c.clean/src/loaders/ttf/tvgTtfLoader.cpp(49): error C3861: 'GetFileSize': identifier not found```
@hermet hermet added the portability Portability Issues among the machines label Jan 16, 2024
@hermet hermet added this to the 0.13 milestone Jan 16, 2024
@rinechran
Copy link
Member Author

Random access, wouldn't it be better to store the data in a std::vector? Mmap is known to be effective when handling both reading and writing

@hermet
Copy link
Member

hermet commented Jan 17, 2024

@rinechran Hello, I don't know where your idea coming from, as the vector is basically based on the linear memory segment. Does it good for random memory access? To discuss the acheivement, it would be better if you suggest the reliable data for this.

The primary purpose of using mmap is not for performance enhancement but to efficiently handle the TTF data during text usage. mmap() facilitates this by reading data at the block level.

@hermet
Copy link
Member

hermet commented Jan 17, 2024

@rinechran By the way, I'm really wondering about the case for directly integrating thorvg in UWP. I might prefer that a UWP app uses thorvg as a static library.

@rinechran
Copy link
Member Author

@hermet I don't particularly prefer it, but if there is a request for UWP support, I think it would be fine to consider it then , vcpkg also supports UWP build, raising the issue

@hermet hermet changed the title UWP build error when building tft loader UWP build error when building ttf loader Jan 18, 2024
@hermet hermet pinned this issue Mar 11, 2024
@hermet hermet self-assigned this Mar 16, 2024
hermet added a commit that referenced this issue Mar 16, 2024
Enhances the portability of the TTF loader on UWP platforms
by implementing an alternative file loading mechanism.

This is designed to support environments where the file mapping
feature is not available, ensuring wider compatibility and reliability
in file handling.

Issue: #1912
hermet added a commit that referenced this issue Mar 18, 2024
Enhances the portability of the TTF loader on UWP platforms
by implementing an alternative file loading mechanism.

This is designed to support environments where the file mapping
feature is not available, ensuring wider compatibility and reliability
in file handling.

Issue: #1912
@hermet hermet closed this as completed Mar 18, 2024
@hermet hermet unpinned this issue Mar 18, 2024
@hermet hermet mentioned this issue Mar 18, 2024
37 tasks
hermet added a commit that referenced this issue Mar 21, 2024
Enhances the portability of the TTF loader on UWP platforms
by implementing an alternative file loading mechanism.

This is designed to support environments where the file mapping
feature is not available, ensuring wider compatibility and reliability
in file handling.

Issue: #1912
hermet added a commit that referenced this issue Apr 5, 2024
Enhances the portability of the TTF loader on UWP platforms
by implementing an alternative file loading mechanism.

This is designed to support environments where the file mapping
feature is not available, ensuring wider compatibility and reliability
in file handling.

Issue: #1912
hermet added a commit that referenced this issue Apr 6, 2024
Enhances the portability of the TTF loader on UWP platforms
by implementing an alternative file loading mechanism.

This is designed to support environments where the file mapping
feature is not available, ensuring wider compatibility and reliability
in file handling.

Issue: #1912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
portability Portability Issues among the machines
Projects
Status: Done 0.13
Development

No branches or pull requests

2 participants