office-gobmx/include/vcl/rendercontext/SalLayoutFlags.hxx
Khaled Hosny b9f0caad5d tdf#66819: Disable ligatures with character spacing
When character spacing is not zero, optional ligatures should be
disabled (e.g. this what CSS requires and what browsers implement:
https://drafts.csswg.org/css-text/#letter-spacing-property).

This disables both “liga” and “clig” OpenType features because they are
optional features and are enabled by default, it does not disable “rlig”
because it is for orthographically-required ligatures, nor “dlig” or
“hlig” because they are disabled by default.

The character spacing values (confusingly called kerning in the source
code) are moved from SvxFont to vcl::Font so it can’t be accessed in
OutputDevice and pass the relevant flag to SalLayout.

Change-Id: Ieacc875df3896ad7a63ae8d116f4c6ff7265b9a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138711
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
2022-08-23 09:24:52 +02:00

44 lines
1.4 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#pragma once
#include <o3tl/typed_flags_set.hxx>
enum class SalLayoutFlags
{
NONE = 0x0000,
BiDiRtl = 0x0001,
BiDiStrong = 0x0002,
RightAlign = 0x0004,
DisableKerning = 0x0010,
KerningAsian = 0x0020,
Vertical = 0x0040,
DisableLigatures = 0x0200,
ForFallback = 0x2000,
GlyphItemsOnly = 0x4000,
};
namespace o3tl
{
template <> struct typed_flags<SalLayoutFlags> : is_typed_flags<SalLayoutFlags, 0x6277>
{
};
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */