While not calling this will work on native x64 machines as it's likely
a no-op under x64, it is possible that the function does something
under emulated environments. As there is no downside to calling this
function, this commit makes the behavior more correct.
ImGui docking functions are called outside our drawing context (from
ImGui::NewFrame), which includes most of dock-related drawing calls.
However, ImGui::RenderWindowDecoration is called from ImGui::Begin,
which may be under the effect of other pushed font. As IG::RWD
references to the ImDrawList irrelevant to the global shared state, it
was trying to draw a rectangle referring to a pixel that is not
guaranteed to be a white pixel. This commit fixes that by forcing the
use of the default font for IG::RWD when the window is docked.
* Implement FontChooserDialog
* Minor fixes
* Fixes 2
* Add Reset default font button
* Add failsafe
* reduce uninteresting exception message
* Add remarks to use AttachExtraGlyphsForDalamudLanguage
* Support advanced font configuration options
* fixes
* Shift ui elements
* more fixes
* Add To(Localized)String for IFontSpec
* Untie GlobalFontScale from default font size
* Layout fixes
* Make UiBuilder.DefaultFontSize point to user configured value
* Update example for NewDelegateFontHandle
* Font interfaces: write notes on not intended for plugins to implement
* Update default gamma to 1.7 to match closer to prev behavior (1.4**2)
* Fix console window layout
* add LoadMethod to DalamudStartInfo
* add to_wstring utility function
* append full injector launch args for VEH
* remove usage of std::chrono::zoned_time
* fix injector arguments in crash handler restart
* enable VEH on wine
* remove dead wine detection code
* write out tspack with std::fstream
* fix off-by-one error in get_window_string()
* remove usage of std::chrono when writing tspack
* do not deadlock on crashing DalamudCrashHandler
You need to enable this to allow debugging, but the label has the
negative which doesn't make sense. Now it's called "Disable Debugging
Protections" which is what it actually does.
The language selector has only been showing language codes and not the
actual language names since dd0159ae5a
because "tw" (Taiwan Mandarin) was added and it's not supported by
CultureInfo.
This adds a specific check like the language code to work around this
and stop throwing exceptions. Also converts to a switch so it looks a
bit nicer.
As `ImFontLocked` utilizes a reference counter, changed it to a class so that at worst case we still got the destructor to decrease the reference count.
`BuildFontsImmediately` and `BuildFontsAsync` set `BuildTask` to completion at different point of build process, and changed the code to make it consistent that `BuildTask` is set to completion after `PromoteBuiltData` returns.
`PostPromotion` is removed, as `IFontHandle.ImFontChanged` now does the job. It also removes the possibility that resources may get disposed while post promotion callback is in progress.
* `IFontHandle.ImFontChanged` is now called with a locked instance of the font.
* `IFontHandle.ImFontLocked`: Added `NewRef` to increase reference count.
These changes are done to ensure that `IFontHandle.Lock` will be guaranteed to obtain a fully built font that will not be modified any further (unless `PostPromotion` is being used for modifying fonts, which should not be done by clients.)
* Moved `CopyGlyphsAcrossFonts` and `BuildLookupTable` from `PostPromotion` to `PostBuild` build toolkit.
* `IFontAtlasBuildToolkit`: Added `GetFont` to enable retrieving font corresponding to a handle being built.
* `InterfaceManager`: Use `OnPostBuild` for copying glyphs from Mono to Default.
* `FontAtlasBuildStep`:
* Removed `Invalid` to prevent an unnecessary switch-case warnings.
* Added contracts on when `IFontAtlas.BuildStepChanged` will be called.
These changes ensure that using a font under some other thread's ownership from the UI thread for rendering into ImGui purposes always work.
* `FontHandle`:
* Moved common code from `DelegateFontHandle` and `GamePrebakedFontHandle`.
* Added `LockUntilPostFrame` so that the obtained `ImFontPtr` and its accompanying resources are kept valid until everything is rendered.
* Added more code comments to `Try/Lock`.
* Moved font access thread checking logic from `InterfaceManager` to `LockUntilPostFrame`.
* `Push`ing a font will now also perform `LockUntilPostFrame`.
* `GameFontHandle`: Make the property `ImFont` a forwarder to `FontHandle.LockUntilPostFrame`.
* `InterfaceManager`:
* Added companion logic to `FontHandle.LockUntilPostFrame`.
* Accessing default/icon/mono fonts will forward to `FontHandle.LockUntilPostFrame`.
* Changed `List<T>` to `ConcurrentBag<T>` as texture disposal can be done outside the main thread, and a race condition is possible.